I have an app where a user absolutely must be logged in to use it.
I use PHP sessions upon login to store user data.
If a user leaves a window open and then returns e.g. an hour later, what's the best way to check if they are logged in still?
Options I can think of are:
1) check mouse movement which then fire AJAX php file to see if session still active
2) check as above on mouse click anywhere
But these will then be running constantly and therefore hitting and hitting the server potentially thousands of times a second with not so many users, so I doubt efficient.
Is there a better way to do this? Is there a 'standard'?
I am using PHP and JQuery.