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

How to kill the session on browser close

 
anmol kumar
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to kill the session on browser closes using java.
i.e, want to capture the event on the browser closes and then kill the session.
 
Ali Gohar
Ranch Hand
Posts: 572
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can invalidate the session using session.invalidate() method.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anmol,
Browsers don't tell servers that the user is closing her browser though. You would have to try some sort of JavaScript for that solution. If you can manage that, only then could you invalidate the session.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Submitting to the server on browser close only works in IE. Search the HTML forum for details. It's been discussed there serveral times.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic