+ 1
How can I destory a session after specific period of time?
I want after the user log in to count 60 seconds then if he stayed more than 60 sec without being active it will destroy the session (when I click refresh on the browser)
1 ответ
0
Try this:
if (isset($_SESSION["LAST_ACTION"]) && (time() - $_SESSION["LAST_ACTION"] > 60))
{
session_unset();
session_destroy();
}
$_SESSION["LAST_ACTION"] = time();