<script type="text/javascript"> window.onunload = function() { //Code to notify server here }; </script>But I tried this and it doesn't work very well. It fires if you close the browser when on a relevant page - which is fine. But it also fires when using the prev/next arrows (which you wouldn't necessarily want since it might just be going to another page on your server) and it *doesn't* fire if you just type in and navigate to another url (which you maybe would want). So I guess your stuck with waiting for the session to expire as an indicator that the user is no longer around. Of course if you shorten the timeout to improve the accuracy you risk p***ing off the user by dumping them out of the session prematurely :-{