This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessionListener if browser is closed

 
Arshad Azeem
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is the sessionDestroyed(HttpSessionEvent event) method in our implementation of HttpSessionListener supposed to be called if the browser is closed? I think it shouldn't be and will not be, but can anyone please confirm?

Thanks,
Arshad.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is supposed to be called if the session is destroyed.

The session will be destroyed when HttpSession#invalidate() is called, either manually by coding or "automatically" by the webcontainer when the session is timed out.
 
Arshad Azeem
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
question is...doesn't the session end when the browser is closed
 
Sunil Vasudevan
Ranch Hand
Posts: 107
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server does not know about user closing the browser. So the session won't end. The session will still be active on the server till the session times out.

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arshad Azeem wrote:question is...doesn't the session end when the browser is closed
Stuff doesn't work that way, no.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic