I can use Server[request_time] to get current timestamp. But how would I use this on each request so that I know which session hasn’t been active for more than 10 minutes? Basically I do not know how to detect these requests so that I can capture the last timestamp(based on that request). Does it have to be attached to every single html button?
I can use Server[request_time] to get current timestamp. But how would I use this
Share
You can save the time of the last request in the session:
You do this on every request.
Before you update the session value, you can check how long the session was inactive:
PS: You can use
$_SERVER['REQUEST_TIME']instead oftime()if you have very long running scrips. In most scenarios it will make no difference.