How to trap window close event of Browser in IE
I want to trap the event of the Window close of the Browser using Java Script so that I can call the function on that event.
I am writing a Client Server application using Java Script and Java Servlets. I am giving client a database connection when the user correctly logins to the server, that connection is returned to the connection pool
when the user logs out using the Logout link.
The problem is when the user closes the browser window (using X) without logging out. I don't know how to trap the window close event of the browser so that I can write the function to return that users connection back to the pool. I have tried using onunload event but it is also fired when the next page is called. I don't know how to go about for the solution.
Re: How to trap window close event of Browser in IE
Not possible, sorry. You can only time out sessions and return the connection then.