Well, in my project when the user logs in the system performs a function that creates a session with his email to authenticate it during the site:
Function:
function logaUsuario($email) {
$_SESSION["usuario_logado"] = $email;
}
Functions that verify that the user is logged in:
function usuarioEstaLogado() {
return isset($_SESSION["usuario_logado"]);
}
function verificaUsuario() {
if(!usuarioEstaLogado()) {
header("Location: login.php");
die();
}
}
However, I need to cause the system to log off after a few minutes of inactivity, but keep the email saved. What would be the best way to "disengage" the user, but continue with your stored email?