Jump to content

Need to log users out after 15 minutes of inactivity


tmyonline

Recommended Posts

Use this code! It works perfectly!!!!

 

if ($_SESSION['last_reload'] != "" && $_SESSION['last_reload'] < strtotime("-15 minutes"))
{
header("Location:http://localhost/erp/logoutd.php");
}
else
{
$_SESSION['last_reload'] = time();
}  

 

Ofcourse, on logoutd.php you need to have session_destroy();

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.