Forum Moderators: coopster
Without digging too deep into programming something yourself, various server logs will track time spent on a webpage and will use the last time an HTTP request was handled as the "exit" time, I think. It should at least give you some pretty reliable data that can be used comparatively. You probably don't want too-the-second data across a big volume website, anyway.
the scenario could be
user logs in and they set the time in the session. Every time they hit a new page it can calculate the time passed since the 'last hit' in the session and add it to the session var 'total time' then update 'last hit' to now().
repeat every time they hit a page.
when they leave, who cares don't worry about it. That's as accurate as you need to be.
most login scripts should check session time already so it should be a small change to display this.