Store the sytem time when the user logs in.
Then when the user logs out and subtract the difference. Put that value into a table to keep track of it.
You would also want to put some code in your global.asax under the Session_End sub so you can store that time in case the user doesn't log out and is timed out instead. That'l do donkey, that'l do Mark
If you are unsure of forum etiquette check here faq796-2540
oddball
closing the browser will not abandon the session.
so
1. put some client side script into all pages so that if the browser is closed, it lauches logout.aspx, and then this is rendered, it abandons the session and closes the window.
or
2. when you calculate the average session time, do not include rows where the time is exactly equal to the session timeout, since this will be those where they just closed the browser and did not log out. This approach will give you a figure for the average session time which will of course be skewed, since you don't know some of the data, but it may suffice
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.