what i'd like to accomplish:
- a member logs in.
- a time stamp is being send to a database
- every minute this member stays on a page, a query is made to the database to update the time stamp.
- a cron job is being made every 3 minutes to query the db and check if the time stamp is 2 minutes older than the actual time.
-if it is, the member is considered logged-out. and the time stamp in the db is being reset.
-if it isn't, the time stamp is being set to the actual time.
the code is to be placed on the php page a visitor to my site is at (in a required footer.php, to be exact).
i've tried using sleep(60) inside an infinite loop (ie: while(2 == 1+1)), but even by experimenting with its placement inside the loop, and flush(), i can't seem to get the desired result. :/
i could get the data i need by recording the PHPSESSID for that particular session, and, using a cron job, un-log the member automatically if the session has been destroyed, but even though i was told the session files are stored in a /tmp folder on my site, i've never been able to see them, let alone access them.
any idea how to accomplish this without using a session time out?
thanks in advance 🙂