How to logout a HttpSession
July 10th, 2003, 12:12 PM
It's not enought !!
In fact, I need too to force the user to re-enter a sign.
It's used when a user want to connect him with 2 differents login on the application.
For IE users, no problems : open a nex browser window is enougth.
But for Netscape user, the pb is tha the sign-on dialog box do not appear when you open a new browser window if it already exist a "signed" window !!!!
July 10th, 2003, 03:01 PM
You're kinda stuck. If you can get the user to manually launch a new instance of the browser, you should be able to get away with it, but I don't think you'll be able to do it programatically. I'm actually really surprised the IE works. I've usually found that IE isn't very friendly when it comes to multiple session.
One thing you might try is to pass the session ID as a parameter on the url, rather than as a cookie. I've never done it before with java, but I know php can do that (I assume java can too). That would mean you could tie a session to a specific window. The user could always copy the session id to a new window, but what are ya gonna do?
July 10th, 2003, 09:42 PM
Actually, IE is consistent in it's behavior of when it shares sessions and when it doesn't. If you spawn an IE window from an existing window, it will share all non-persistent cookies (of which the session cookie is). There are several ways a new window can be spawned from an existing window:
1. The new window can be spawned by clicking a link or submitting a form with a "target" of "_blank" (or any target name that is not the current window).
3. It can be opened using crtl-n.
There are probably more. If a new window is opened any of these ways, then the spawned window will share all existing in-memory cookies with the 'parent' window.
If you open a new IE by double clicking it's icon, then it will not share the in-memory cookies. It will start a brand new session.
This can be tested if you are currently logged into devshed here. If you crtl-n a new window and look, that window will show you logged in. If you open a new IE using the icon and navigate to devshed, that window will not be logged in (it will show your name as "browsing the forum", but that window itself is not logged in).
July 11th, 2003, 06:09 PM
That's the behavior that I have observed, yes, but, it seems that vporcuna is getting some different results. Not sure why, though.