I have a problem with the session in php as I assign a variable inactivity condition to the closing session?
I have this code:
$fechaGuardada = $_SESSION["ultimoacceso"]; 
    $ahora = date("Y-n-j H:i:s"); 
    $tiempo_transcurrido = (strtotime($ahora)-strtotime($fechaGuardada)); 
    //comparamos el tiempo transcurrido 
     if($tiempo_transcurrido >= 10) { 
       //si pasaron 10 segundos o más 
        session_destroy(); // destruyo la sesión 
        header("Location: index.php"); //envío al usuario a la pag. de autenticación 
        //sino, actualizo la fecha de la sesión 
      }
The problem here is that you log in at given time, in this case it's 10 seconds.
How do I get the condition to run after an inactivity for 10 seconds?
 
    