【发布时间】:2015-05-02 10:09:30
【问题描述】:
我想在 10 分钟后重定向页面并清除会话值。 我使用代码实现了这一点。我网站中的任何页面都会在 10 分钟后重定向
<META HTTP-EQUIV="refresh" CONTENT="600;URL=logout.php?timeout">
在我的 logout.php 页面中,我有清除会话值并重定向到 index.php 页面的代码。但是现在我只重定向到 index.php 页面并且会话值没有被破坏。
<?php
session_start();
// remove all session variables
session_unset();
// destroy the session
session_destroy();
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.location.href='index.php';
</SCRIPT>");
?>
【问题讨论】: