I've knocked together a membership system for my site using php/mysql. As part of it I want to keep statistics of which pages visitors access and how long they spend there.
If they use the nav menu or back button it works fine as each time they access a page, I put the logout timestamp on the current record and create a new 1 for the page they go to.
However, if the visitor leaves the site by simply closing the window rather than logging out properly, I'm left with a record that has no logout timestamp. Obviously that will play havoc with my stats. Is there anyway I can get around this?
If they use the nav menu or back button it works fine as each time they access a page, I put the logout timestamp on the current record and create a new 1 for the page they go to.
However, if the visitor leaves the site by simply closing the window rather than logging out properly, I'm left with a record that has no logout timestamp. Obviously that will play havoc with my stats. Is there anyway I can get around this?
