変数の非アクティブ状態を終了セッションに割り当てるため、php のセッションに問題がありますか?
私はこのコードを持っています:
$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
}
ここでの問題は、特定の時間にログインすることです。この場合は 10 秒です。
非アクティブ状態が 10 秒間続いた後に条件を実行するにはどうすればよいですか?