File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes logout on browser close Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "logout on browser close" Watch "logout on browser close" New topic

logout on browser close

Alex Kravets
Ranch Hand

Joined: Jan 24, 2001
Posts: 476
How do I run logout routine when user closes a browser?

All right brain, you don't like me and I don't like you, but let's just do this one thing so I can get back to killing you with beer.<br /> <br />- Homer Simpson
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

I wouldn't bother trying. It requires correctly catching browser events client-side (and firing off a request to the server) which is a black art, and never works the way you want it to. Easier is to timeout idle sessions.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Alex Kravets
Ranch Hand

Joined: Jan 24, 2001
Posts: 476
thanks for the info!
jQuery in Action, 2nd edition
subject: logout on browser close
Similar Threads
session invalidation
How to do logout when browser closes in jsf
how to implement logout functionality?
User closing browser
URL filter