我陷入了会话超时循环,
一旦会话超时,我将无法重新登录
<?php
if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 300)) {
header("location:../index.php");
exit();
}
$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
?>
这是我包含timeout.php的地方
<?php
//$now = 0;
if (isset($_REQUEST['err'])){
$now = $_REQUEST['err'];
}
?>
<?php
session_start();
include('../includes/session_timeout.php');
if(!isset($_SESSION['isactive'])){
header('location: index.php?e=li');
}
include('../../administrator/includes/constants.php');
include('../includes/functions.php');
if(isset($_REQUEST['p'])){
$cmd = $_REQUEST['p'];
}else{..........etc
答案 0 :(得分:0)
尝试在重定向之前取消设置会话变量
session_start();
if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 300)) {
unset($_SESSION['LAST_ACTIVITY']);
header("location:../index.php");
exit();
}
$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp