Hello all,
I'm somewhat of an amateur with PHP, working on my first full application, learning as I go and I've hit my first major snag.
I'm building a website where users can login and logout. One thing I want to show is who is currently logged in. I created a field in my users table to hold the current status (1 = online, 0 = offline). Here's my snag.
What if the user just closes the window without clicking log out? I've read many articles on the subject and most suggest using timestamps and running cron jobs to check the time since the last timestamp.
I, however, do not have access to cron on a shared hosting plan and really can't afford, at this time, to go 'dedicated'.
Am I SOL? Is there a way to log the user out 'in the server database and the session' when the user closes the window or after a set amount of time?
Any help or steps in the right direction would be greatly appreciated.
Thank You.