Right now when a user clicks the logout button it calls my logout function which does this
//Logout
function logout()
{
//logout if they are currently logged in
$_SESSION = array();
session_destroy();
setcookie(session_name(),'',time()-300);
header("Location: login.php");
exit();
}
However, in addition to this I would like to set it up to also destroy the session and log out after a period of inactivity, probably 15 minutes or so. Just trying to determine the best method of handling this?
Thank you!