简体   繁体   中英

How to expire page in PHP when user logout

当最终用户点击浏览器的LogOutBack按钮时 ,我想要使我的上一页过期。

If you include this at the top of all of your pages, it will require the client to always reload the content, making the back-button requesting a new copy of the page.

<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

http://php.net/manual/en/function.header.php

使用session_destroy();销毁会话密钥session_destroy();

浏览器后退按钮可能会出现一些问题,因为单击时,某些浏览器根本不会从服务器重新加载页面,而是从缓存中显示页面的先前状态。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM