Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt regarding sessions

 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • 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.
 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • 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.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
thank you guys for clearing my doubt.

Dinuka Arseculeratne
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic