TimeOut for re-authentication, only if user is inactive
I think I have an interesting question for y'all..
What I need is a method that forces a user to re-authenticate themselves (log-in again...) after they stayed on a certain page for a certain time, but ONLY if they actually where inactive during that time! Quite possibly they needed to read a bit, or whatever so they exceeded the 5/10 minute timeout I have in mind.. But if they used their mouse, entered data or whatever, I don't want the page to time out!
How would you deal with this?
What I came up with so far is have a timer running in the background (using setTimeout and an infinite loop method call). I can currently reset the timer by clicking a button (I have the method for that), now I just need the proper event to keep track of user activity..