File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Servlet session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet session" Watch "Servlet session" New topic

Servlet session


Joined: Jul 31, 2001
Posts: 6
If i open a new window from the current browser window, both window is part of the same session. How can I assign a new session to the new window, keeping the session for the current (first) window same?
Please answer...
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
I don't think you can since session is typically based on cookies. However you can distinguish between the windows by writing hidden variables in forms.
Jeff Sunder
Ranch Hand

Joined: Jun 26, 2001
Posts: 47
When the new browser is opened, you can invalidate the exisitng session and then create a new one. You can create a new session by calling request.getSession
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Jeff I�ve never done this but I think if you invalidate the session from the other window you�ll gonna loose the session in the first one as well don�t you?
I agree. Here's the link:
subject: Servlet session
It's not a secret anymore!