how to track the logout timestamp using php.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
krishna.p
Forum Newbie
Posts: 19
Joined: Fri May 23, 2008 8:12 am

how to track the logout timestamp using php.

Post 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
mikelbring
Forum Commoner
Posts: 38
Joined: Sat Jan 05, 2008 5:28 pm

Re: how to track the logout timestamp using php.

Post 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.
krishna.p
Forum Newbie
Posts: 19
Joined: Fri May 23, 2008 8:12 am

Re: how to track the logout timestamp using php.

Post 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.
mikelbring
Forum Commoner
Posts: 38
Joined: Sat Jan 05, 2008 5:28 pm

Re: how to track the logout timestamp using php.

Post 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.
Post Reply