我想在 10 分钟内会话过期后从 index.php 自动注销。请帮忙?
我已经有了这个:
//this is login.php
//register the session for user and password
session_register("userName");
session_register("password");
if($userType=="Web_User"){
header("location:index.php?");
}
//index.php
//check session start or not
<?php
if (!isset($_SESSION['start_time']))
{
$str_time = time();
$_SESSION['start_time'] = $str_time;
}
echo $_SESSION['start_time'];
//here I want to expired if user inactive for 10 minutes and redirect to the login.php
?>