I have a login system. With my store accounts and cookies (if you "remember me"), and then you log in. When you are in the home.php login system (you can only enter session / cookie registration), I want the status field in the user table to be updated online and offline when you log out.
I know how to do this in order to update the status when I log in and log out, but here's what: How do I do it when a user leaves the site without logging out (by clicking the actual logout button)? I mean, if the status is set to online and you leave the page, it will remain online, you can understand ..logic .. so what am I doing in this situation? I don’t want to have a little ugly popup that will log out when you leave the page, which is so old school and bad.
Or maybe when the session ends, you set the status offline? but then again, how should I do this?
Ideas and solution examples for this would be good.
Sites such as facebook, in chat, you change the status to Idle if you leave the page, and for some reason, if you leave the page and you have time when you are offline ... Like, I don’t I know.
Karem source
share