This is one of the most often asked questions in the forum... Do a search and you should be able to find more info. The main point is that you can't be guaranteed that your server will be notified everytime a browser is closed, so don't count on it.
You don't know when the user closes the browser. This is why you have a session timeout. There is no way to tell from the server side if the user has already left or not until the session has timed out. -Dale
By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)