• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session object

 
revup triv
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens to the session object when user closes the browser window & opens another browser or when clicking a button on one window opens another window?
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It all depends on the browser, and how long your server specifies the the browser should keep the cookie around (if you're using cookies at all!).
 
S Subramonyan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I think is:

Session does not get destroyed until (a) the value set in setMaxInactiveInterval reaches Or (b) session-timeout in session config of web.xml reaches. setMacInactiveInterval takes precedence over session-timeout in deployment descriptor.

When the user clicks on a button in a window that participates in a session, the new window will automatically be a part of the current session.


This is what I think, we'll wait for someoneelse's opinion too.

Cheers!
 
Jyothi Lature
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If a user closes his browser window, it will not destroy the session object on the server. It merely looses the session identifier it used to identify itself on the server, thus creating an illusion that the session is destroyed.
The session object will actually live on in the server until it reaches the session time out.
Try testing the session time out, or destroy a session explicitly by calling the invalidate() method, and you'll see that your container will call the sessionDestroyed method, where as when you close a browser sessionDestroyed method is not called.

When you click a button on the window and another window opens, it will have same session object with it.

Hope this helps.
 
revup triv
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all. Your responses were very helpful
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic