Is there a way I can piggy back sessions to know if the user is online?
I.e: use logs on, I set a $_SESSION variable, user times out- cookie Garbage collector update
My way may not be the best way but since my site and userbase is all in mysql DB, when a user logins into my site,
Then on every page load I check for the online time session, if it exist, I check to see how old it is, if it is less then 5 minutes old, I do nothing, if it is older then 5 minutes, then I update the session time again with current time and also update the online users table with the time
Then I have a cron job that runs every 10 - 15 minutes that deletes any uses from online table and marks there user table as offline if there online time has updated within X amount of minutes