I want to track if users loout or their session expire. I need to k now exactly when their session expired (within +/- 5 min). Right now if a users leaves the page open in the browser and returns after a day, I will know it expired when he tries to do something after a day- but in reality the session expired after say an hour of inactivity.
I want to have a script run every 5 minutes on the server and check which sessions are expired and detect them and then log the expiration time in a db. How do I have a script run continuously with such short intervals on the server? What exactly does the script do? Is there a better way to do this?