Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about HttpSession  RSS feed

 
Benny Tang
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
When the user close the browser, is the session terminate immediately or it will timeout after a specific period of time?
Thank you for your kind attention.
Yours faithfully,
Benny
 
ib idris
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The session is terminated immediately.
http://galileo.spaceports.com/~ibidris/
 
Gayathri Prasad
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Sessions would be terminated the moment we close the broswer Yes I know this .. But how abt some thing called Server side cookies and When we keep time out for server side cookies would they be active even If I close by browser window ?. Lil more knowledge on server side cookies would help mr frnds ...

Cheers,
Gaya3
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clarification -
1. The browser destroys the cookie that contains the sessionID when it is shut down because that terminates a session.
2. The servlet engine DOES NOT destroy the HttpSession object immediately because it does NOT know that the browser can't use it anymore. Instead, the session will be disposed after a period of inactivity - typically 30 minutes.
3. "Server side cookies" ?? is a meaningless term - unless you are talking about the Cookie object used to represent a cookie as sent by a browser in a request or set by the servlet in a response.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!