• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

session object

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!).
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all. Your responses were very helpful
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic