Page 1 of 1

how to track the logout timestamp using php.

Posted: Mon Jan 05, 2009 6:19 am
by krishna.p
Hi Experts,
i am new to php. i would like to implement login/logout functionality to my application. In my application, i have to track the login and logout timestamp of an user. When user logins into my application, iam able to track the timestamp and able to update the timestamp into database.
However, iam unable to track the logout timestamp. If the user clicks on LOGOUT button, iam able to track the timestamp. but if the user simply closes the application or simly uses Alt+F4 keys iam unable to catch the timestamp. In both these cases, i would like to catch the timestamp and update it into database. Would appreciate if any of you could help me out. Thanks in advance.

Thanks,
Krishna.P

Re: how to track the logout timestamp using php.

Posted: Mon Jan 05, 2009 7:38 am
by mikelbring
The most you can do in this case is track a last activity timestamp. As in everytime they go to a page update the last activity timestamp. If they haven't done anything say in the last 10-15 minutes then they probably are no longer on your site.

Re: how to track the logout timestamp using php.

Posted: Mon Jan 05, 2009 7:48 am
by krishna.p
thanks for the reply..would appreciate if you could please tell me that how we can track the last activity timestamp. you mean last activiy timestamp is nothing but last time user made a server call or it can be just a last accessed time.

Re: how to track the logout timestamp using php.

Posted: Mon Jan 05, 2009 8:19 am
by mikelbring
As in everytime a user goes to a page on your site it would update a lastactivity cell in the database, just like you do when they login.