The window.close() method
Make sure your session.setMaxMaxInactiveInterval(int) is set to an appropriate period so that its long enough so it doesn't kill people's sessions who are just slow while surfing around your site, and its short enough to invalidate people's sessions who have left your site without logging out.
- Jessica Bradley
Try catching *THAT*
[This message has been edited by Tim Holloway (edited December 18, 2001).]
Originally posted by Reeti Saha:
I'm using jsp for my web based project. I've written code for some clean up operation when a button is pressed..but I want the same method to be executed if a user closes the browser window also.
Pls. let me know how to proceed.
It depends on the browser you are using.
I expect it will be a bit tricky but it should be possible.
You can try this method.
This seems to be unconventional approach but will definitely address your problem.
This won't solve the problem like if somebody switches off the computer or network go hay-wire..
Hope this helps
(if you open a second separate window and wait for a response in the second that window but the user closes the second window then you have to open a third window to handle the second one closing prematurely etc etc)