Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

logout or timeout?

Status
Not open for further replies.

JRBeltman

IS-IT--Management
Feb 5, 2004
290
0
0
NL
Hi all,

I am having people logging in and register their username in a session on succesful login.

However when they logout I want to write the date and time to the database so I can track their behaviour.

But what to do when they just close the browser without logging out properly?

How can I write this value to the database?

Any clever solutions?

Cheers

JR
As a wise man once said: To build the house you need the stone.
Back to the Basics!
 
To the best of my knowledge, you can't. If a user simply closes the browser or points his browser to a location that's not a part of your site, no information will be transmitted to your server. So there's nothing to record. This is just the statelsss, discontinuous nature of HTTP.


If you need to record something, you might use custom session-store handling functions on your site. Create a custom garbage-collecting function which records a "logout" time for session stores it removes.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Right,
I was afraid of having to do some homework!

Thanks for the link and answer

JR
As a wise man once said: To build the house you need the stone.
Back to the Basics!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top