Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet session

 
dluckose
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Bill
 
Jeff Sunder
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic