Currently I have used HttpSessionListener to find if the session has timed out or the user has used the logout button.
What I want to do is to detect when the user closes the tab/window where my application is, in order to destroy the session, so he/she can log again if the user opens another window (only one session per user is allowed).
I know that in Firefox I can use the onclose event to send that information to the server, but I also need to do it in Internet Explorer and chrome (at least).
Care to share any suggestions? Thank you very much in advance.
Please SearchFirst. You will find that this issue has been discussed dozens of times, and that the conclusion is always that you cannot detect when the browser is closing, and you must rely on the session timeout to allow the session to invalidate itself when the timeout expires.