vendredi 28 mai 2021

User online/offline status via PHP

I am new to PHP, and I wanted to know how I can establish a user online/offline feature. I've looked up similar questions already but I just couldn't figure out how to: (for example)

Change the status to offline when the user don't do anything for n amount of time. (Like how does PHP run code without the user being on the site, or JavaScript/ajax).

How do I check the status from a user once every idk like 5 seconds or something.

I've established a database table with 2 columns being userLastLogin and a userStatus If I log out and in it changes the status but what about when the user decides to just leave the website without logging out. How do I do this?




Aucun commentaire:

Enregistrer un commentaire