From 3aefd53f0698685a61f4f83a0529670653941a7d Mon Sep 17 00:00:00 2001 From: Patrik Benyak Date: Wed, 12 Jun 2019 02:02:36 +0200 Subject: [PATCH] #136 Fix incorrect redirect type --- actions-web.php | 9 ++++++--- common.php | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/actions-web.php b/actions-web.php index 06a4b449..992e676a 100644 --- a/actions-web.php +++ b/actions-web.php @@ -547,15 +547,17 @@ function login($number,$password) $db->conn->commit(); setcookie("loguserid",$userId,time()+86400*14); setcookie("logsession",$sessionId,time()+86400*14); - header("HTTP/1.1 301 Moved permanently"); + header("HTTP/1.1 302 Found"); header("Location: ".$systemURL); + header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); header("Connection: close"); exit; } else { - header("HTTP/1.1 301 Moved permanently"); + header("HTTP/1.1 302 Found"); header("Location: ".$systemURL."?error=1"); + header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); header("Connection: close"); exit; } @@ -572,8 +574,9 @@ function logout() $result=$db->query("DELETE FROM sessions WHERE userId='$userid'"); $db->conn->commit(); } - header("HTTP/1.1 301 Moved permanently"); + header("HTTP/1.1 302 Found"); header("Location: ".$systemURL); + header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); header("Connection: close"); exit; } diff --git a/common.php b/common.php index 980b6445..87cee584 100644 --- a/common.php +++ b/common.php @@ -214,16 +214,18 @@ function checksession() $db->conn->commit(); setcookie("loguserid","",time()-86400); setcookie("logsession","",time()-86400); - header("HTTP/1.1 301 Moved permanently"); + header("HTTP/1.1 302 Found"); header("Location: ".$systemURL."?error=2"); + header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); header("Connection: close"); exit; } } else { - header("HTTP/1.1 301 Moved permanently"); + header("HTTP/1.1 302 Found"); header("Location: ".$systemURL."?error=2"); + header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); header("Connection: close"); exit; }