Home > Backend Development > PHP Tutorial > 注销后 点击浏览器退后 又回到登陆后的界面

注销后 点击浏览器退后 又回到登陆后的界面

WBOY
Release: 2016-06-13 12:38:15
Original
1083 people have browsed it

注销后 点击浏览器后退 又回到登陆后的界面
有三个界面 logon.php / checklogon.php / detail.php / logout.php

logon.php - session_start() 还有包括登陆form等的其他静态html,点登陆了按钮后跳转到checklogon.php.

checklogon.php - 连接数据库并返回用户信息。如果成功$_SESSION['user'] = 用户的相关信息,并跳转到detail.php。

<br />
$user = UserBusiness::GetUser($_POST["username"], $_POST["password"]);<br />
if($user == null)<br />
{<br />
	header("location: /index.php");<br />
	exit;<br />
}<br />
$_SESSION['user'] = $user;<br />
Copy after login



detail.php - 上面包括了一个注销link,单击后会调用logout.php.

logout.php -
<br />
<?php<br />
 session_destroy();<br />
 header("Cache-Control: private, must-revalidate, no-store");<br />
 header("Pragma: no-cache");<br />
 header("Expires: Sat, 26 Aug 1997 05:00:00 UTC");<br />
 header("location: /logon.php");<br />
 exit();<br />
?><br />
Copy after login



当点击了logout按钮后,页面到了登陆界面,但是点击浏览器的后退按钮后(IE 8/Firefox),前一个detail界面又显示了。 请问大家如何解决。

当点击后退按钮后,detail.php里面的代码并没有执行,应该是缓存的detail.php有显示了出来。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template