• 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

doubt regarding sessions

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi everyone,

i have a small doubt regarding sessions that i would like to clarify with you guys. say that a user closes the browser while on a site. does the servlet give up the session as soon as the user closes his/her browser or does it close the session when the maxInActiveInterval() has reached?

thank you

Dinuka Arseculeratne.
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Arseculeratne,
i guess the server has no way of knowing that the browser was closed.So it should be like invalidating the session only after the max interval time has elapsed.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The application cannot find out when the user has closed his browser. So the session times out when the interval inactive interval times out.
 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you guys for clearing my doubt.

Dinuka Arseculeratne
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey i will give a nice example to clarify more -

Say you went at a shopping mall, filled your shopping cart with things,
suddenly you got a urgent call from home and left for home keeping the cart as it is there.The person at the shopping mall wont have a idea and will not even touch your cart. But after some time, may be at the end of the day he will disassemble your cart.

Similary, if you are into a SESSION on a website, and suddenly close the browser, your session is still maintained. The server/container will not touch it for some time - determined by the setMaxAgeInterval( ) [if its set]. After that interval expires OR after some CONTAINER speecific time expires, the container will INVALIDATE the session

Hope that helps you understand even better
 
Put a gun against his head, pulled my trigger, now he's dead, that tiny ad sure bled
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic