0
I am trying to put on my page that if the visitor becomes 20 minutes inactive, the session expires, php destroys the session and redirects the visitor to the login page. But it’s not working. My code is like this:
session_start();
$_SESSION['inicio'] = time();
$_SESSION['final'] = $_SESSION['inicio'] + (1 * 60) ;
$agora = time();
if(isset($_SESSION['final'])){
if($agora > $_SESSION['final']){
session_destroy();
header("Location: ../index.php?id=998&tp=bi");
}
}