tags:

views:

14

answers:

1

how to prevent user to relogin in the same browser but different teb.Suppose i have loggid in gmail in a browser.But in the same browser in different tab ,if i login again, it will redirect me to the same page but my requirement is that it should redirect me to the gmail home page.Can any one solve this plz....

A: 

You'll need to store two cookies, and you'll need a way to distinguish between the two cookies in the two sessions. The only way I know to do this is to encode part of the cookie in every single GET query made from a single "session".

Lie Ryan
But in a same browser ,the session and cookies are same.so how can i store two different cookie and session plz make me clear
Debasish Bhadra
@Debasish Bhadra: by encoding part of the session data in the GET string in the URL. So, all URLs coming from session one will contain `?s=1` at the end of the URL and all sessions coming from session two contains `?s=2`; something similar to that. Then, it doesn't matter if the browser sends two cookies since the server can use the GET data to determine whether to use `cookie-1` or `cookie-2`. There might be an easier way, but I don't currently know how.
Lie Ryan