Due to disconnected nature of the Web applications it's a bit hard (and
always not reliable).
First you need to define for yourself "exit time".
Then you need to define precision. For example "We need 1 hour timeframe".
Meaning that if user left 8:50 and we detected it by 9:00 then we fine... .
-------------------------------------------------
Here are some thing you can test if they going to work for you.
1. You can get last time user has requested anything from your site. And
call it your "exit time". Basically update exit time everytime user had send
a request to aspx. At the end when user closes the browser you will have
last "exit time".
Problem: if user requested page "article.aspx" and then sitting there
reading it for 30 minutes and then closes browser you will have exit time 30
minutes before user actually closed the browser...
But this comes does to definition of what is "exit time".
2. To reduce lag time specified in #1 you can have a JavaScript that would
refresh a tiny image on your page every minute. then if user looked at your
page for 30 minutes you will have exit time within one minute range...
But this comes down to the precision... And obviously will have a problem if
JavaScript is disabled.
Check out this on how to do that with an image...
http://www.codeproject.com/KB/aspnet/SessionForever.aspx