我在php文件中有這個代碼,它包含在我要共享的所有頁面中并保護我的頁面.
session_name("login");
session_start();
if (!isset($_SESSION['UserId'])) {
if(!header("Location: https://subdomain.mywebsite.com/"))
{ die("Unauthorized access"); }
}
session_regenerate_id();
$UserId = $_SESSION['UserId'];
問題是我說有一個頁面
Register > Select Service > Select Payment Mode
假設在付款模式下,用戶意識到他在第2頁輸入錯誤,選擇服務,他按下后退按鈕,由于會話的使用而發生錯誤.
錯誤是
Document Expired
This document is no longer available.
The requested document is not available in Firefox's cache.
As a security precaution, Firefox does not automatically re-request sensitive documents.
Click Try Again to re-request the document from the website.
我應該如何處理此類事件,我想使用會話來保護我的頁面,但我也希望用戶能夠在不損害會話的情況下返回上一頁.