久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

點擊后退按鈕重新加載頁面

Reload the page on hitting back button(點擊后退按鈕重新加載頁面)
本文介紹了點擊后退按鈕重新加載頁面的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個需要登錄的網頁.一旦用戶登錄,我就開始會話,一旦他退出,我就會銷毀它,但是當我按下后頁時,它再次為我提供了用戶配置文件頁面,理想情況下不應該是這樣,因為用戶已注銷.但是,如果我在注銷后重新加載頁面,它就可以正常工作.

I have a webpage that requires login. Once a user has logged in I start the session and once he logs out I destroy it, but when I press the back page it gives me the user profile page again which ideally should not be the case as the user has logged out. However, it works fine if I reload the page after logging out.

這是一個本地聊天室,在線和登錄的每個人都可以在這里聊天.一共有三個頁面:login.phpauth.phplogout.php

It's a local chatroom where everybody online and logged in can chat together. There are three pages: login.php, auth.php, logout.php

login.php 是包含表單的常見登錄頁面.auth.php 有一個 div 顯示所有以前的聊天直到現在,一個文本框和共享按鈕,點擊后一個表單被再次發送到 auth.php 所以每次表單是發布聊天帖子將發送到數據庫,并使用聊天 div 中的最新數據庫重新加載身份驗證..

login.php is the common login page containg a form. auth.php has a div displaying all previous chats up til now, a textbox and share button on clicking which a form is sent again to auth.php so everytime the form is posted the chatpost is sent to database and auth is reloaded with the latest database within the chat div..

現在的問題是,一旦我注銷,我就會取消設置所有變量并銷毀會話,但即使如此,如果我在瀏覽器 (Safari) 中按下后退按鈕,之前版本的 auth.php 沒有最后一個聊天條目是可見的,理想情況下不應該因為會話被破壞.我在 auth.php 中放置了一個會話驗證,所以基本上我希望 auth.php 重新加載用戶在重新加載 auth 后注銷后訪問它.php 顯示您尚未登錄"

Now the problem is once I logout I unset all the variables and destroy the session but even then if I hit the back button in browser (Safari), the previous version of auth.php without the last chat entry is visible which ideally should not as the session is destroyed. I have put a session validation in auth.php, so basically I want the auth.php to reload of the user visits it after logging out as reloading auth.php displays that "you are not logged in"

我試過了

<?php header("Cache-Control: no-cache");
header("Pragma: no-cache");
?>
and
<head>
<meta http-equiv='Pragma' content='no-cache'>
<meta http-equiv='Expires' content='-1'>
</head>

抱歉問了這么長的問題,但我真的需要這方面的幫助.

Sorry for the lengthy question but I really need help on this.

推薦答案

這些標頭將強制瀏覽器和代理(如果有)不緩存頁面并強制向服務器發送該頁面的新請求:

These headers will force the browser, and proxies if any, not to cache the page and force a new request to the server for that page:

  header("Cache-Control: private, must-revalidate, max-age=0");
  header("Pragma: no-cache");
  header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // A date in the past

這篇關于點擊后退按鈕重新加載頁面的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 久久久久久久一区 | 91社区视频 | 亚洲一区久久 | 老牛嫩草一区二区三区av | 亚洲区在线| 成人在线电影网站 | 欧美aaaaa | 国产高清一区二区三区 | 美女福利视频一区 | 中文字幕四虎 | 久久精品一区二区视频 | 91看片免费 | 国产精品污www在线观看 | 夜久久 | av黄色在线观看 | 91av久久久| 成人在线不卡 | 伊人久久大香线 | 亚洲国产精品99久久久久久久久 | 在线不卡视频 | 国产在线观看一区二区 | 色婷婷av久久久久久久 | 国产超碰人人爽人人做人人爱 | 又爽又黄axxx片免费观看 | 精品国产乱码久久久久久蜜退臀 | 中文字幕精品一区二区三区精品 | 黄a免费看 | 国产午夜精品视频 | 国产精品久久久久久亚洲调教 | 在线观看亚洲 | 色综合天天网 | 国产精品美女久久久久久不卡 | 男人电影天堂 | 精品一区二区av | 国产一级黄色网 | 久色网| xx性欧美肥妇精品久久久久久 | 欧美午夜精品理论片a级按摩 | 中文字幕国产精品 | av男人天堂影院 | 久久合久久 |