Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Wanted: surefire way to invalidate session when browser is closed

843840Feb 14 2002 — edited Mar 13 2008
Goal: to invalidate a session if the user closes the browser.

What I already know:
1) I know how to invalidate a session.
2) I know how to cause a session to timeout after a certain time interval has passed.
3) I know that the on onbeforeunload event fires if a browser closes, or if the user hits the back button, or any number of other things. This won't work, it's too general. I need an event specific to browser close.

Please don't tell me what I already know. However, if there is no way to detect browser (and browser only) close, but you have some other surefire approach for invalidating a session when the browser is closed, points will be awarded for that.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2008
Added on Feb 14 2002
21 comments
791 views