PHP Session的过期机制

= $expireAfterSeconds) {
        // 用户过久未动作(大于有效期),删除会话
        session_unset();
        session_destroy();
    }
}
 
// 设置现在为用户的最后动作时间
$_SESSION['last_action'] = time();
?>
 

 

你可能感兴趣的:(PHP)