【发布时间】:2015-04-28 08:55:56
【问题描述】:
我的 php 网站上的页面需要一直刷新。例如,我为每个不同的用户设置了一个时间表,如果我登录并查看时间表并注销,那么当我以其他用户身份登录并查看该时间表时,它将显示以前的人员时间表,除非我刷新它。我的网站上有更多页面存在此问题。我需要在注销时做一些额外的事情吗?我知道我可以使用 ctrl+f5 但我希望网站能够为我管理事情。有没有其他人对此有类似的问题任何建议?
这是我的注销代码:
<?php
//include 'header.php';
session_start();
include 'dbconnect.php';
//set the session date in to an empty array
$_SESSION = array();
//Expire thier cookie files
if (isset($_COOKIE["user"]) && isset($_COOKIE["pass"]))
{
setcookie("user", '', strtotime( '-10 days'), '/');
setcookie("pass", '', strtotime( '-10 days'), '/');
session_destroy();
}
//destroy the session variables
session_destroy();
//double check if the user exists
if (isset($_SESSION['username']))
{
header("Location: message.php?msg=Error:_Logout_Failed");
} else {
session_destroy();
header("Location: index.php");
exit();
}
session_destroy();
?>
【问题讨论】:
标签: php browser-cache