Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have facing problem when i do after LogIn the generated URL copy into another browser a user show logged in.So that how can i encrypted this URL when i am going to copy URL in another browser it shouldn't show logged in. how can i do that.
Thanks.
Posted

I have facing problem when i do after LogIn the generated URL copy into another browser a user show logged in

That's because the user is logged in. Session cookies are stored per browser (generally) and therefore another window of the same browser will share the session with the one in which they logged in. This is nothing to do with encryption or otherwise of the URL.

It is possible to stop a user using multiple windows – and even to stop them logging in twice from different browsers or different machines, if you really try. But before I give you any information about that, why do you want to prevent the user having two views of your site up at once? Generally that is a sign of lazy coding and leads to annoying websites and it is much better to craft your site such that two windows does not cause you a problem.
 
Share this answer
 
Comments
raviprajapat 11-Jul-11 16:02pm    
Because of security purpose i want to do it.
BobJanova 11-Jul-11 16:23pm    
That's not really an answer. There's nothing insecure about the same user being able to view different parts of your site in two windows.
Sergey Alexandrovich Kryukov 11-Jul-11 22:44pm    
You won't add any security the way you want.
--SA
Sergey Alexandrovich Kryukov 11-Jul-11 22:44pm    
Great point. I agree, my 5.
--SA
raviprajapat 12-Jul-11 10:02am    
When i Copy link after login that link i past one pc to another pc browser is also show user logged in. so what i am doing for that.
This is what I understood,
1.) You log into you website.
2.) Copy the url, and paste it in another browser.
3.) Now, the new one shows that you have already logged in. Right?
Dude, you don't need to encrpyt the url or for that matter anything in this case. (if, I am not really missing something).
There could be many reasons why the website shows that you are already logged in:
1.) you might be using request parameter which says that you are logged in.
2.) a request parameter which contains a user name, and some (incorrect) logic in web which checks if the user is laready logged in. (Picking up status from diff session?)
You really need to give us more info to help you.
 
Share this answer
 
Comments
raviprajapat 11-Jul-11 9:54am    
i follow this process to open authenticate page after login
1) First login user name and password
2) After login Create session and put ID into Session.
3) on load of Authenticate page check IF session have id or not if have id user can access authenticate page and login status show Login Successfull.
if not have id the page redirect on Login page.
Is ok or need more detail.
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900