Reputation: 31
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?
Upvotes: 3
Views: 6466
Reputation: 172200
In your global.asax
, you can capture the Session_End
event. See this question for further details:
Note that a five minute timeout is not easily possible, since you have to wait for the session to expire (= usually 20 min.) before you can detect the inactivity. Thus, if you really need the short interval, you'd need to
On the other hand, you also need to
Upvotes: 10