Jump to content

[SOLVED] User's Online


Recommended Posts

I basically just need to be able to display all logged in users.

 

The actual log in authentication I'm able to cope with and I can also get logged in users into a dbase table so as to display them.

 

However I'm stuck on how to delete them from the table in the event of them logging off the site. I found tutorials but as always seems to be the case they're never exactly what you need.

 

In short how can I clean up a mySQL table if the user logs off and the session ends.

 

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/49552-solved-users-online/
Share on other sites

You need to store a timestamp along with the users details in the database. You then need to update this timestamp on all page requests, while your at it run a DELETE query to delete any user who's timestamp is older then say 10 mins. You could also run a cron job every 10 minutes to perform the DELETE query.

Link to comment
https://forums.phpfreaks.com/topic/49552-solved-users-online/#findComment-242911
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.