From b38c35fe90d7d726b07a9bc637794990dbe78a5d Mon Sep 17 00:00:00 2001 From: Thomas Portelange Date: Mon, 27 Apr 2020 13:51:19 +0200 Subject: [PATCH 1/2] Fixes warning if session is not active See issue https://github.com/silverstripe/silverstripe-framework/issues/9496 --- src/Control/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Control/Session.php b/src/Control/Session.php index e3c674b16..5fc0f6c1e 100644 --- a/src/Control/Session.php +++ b/src/Control/Session.php @@ -648,7 +648,7 @@ class Session */ public function regenerateSessionId() { - if (!headers_sent()) { + if (!headers_sent() && session_status() == PHP_SESSION_ACTIVE) { session_regenerate_id(true); } } From 2f3c0fc8ddc863213e704ae4264caaf441a251b7 Mon Sep 17 00:00:00 2001 From: Thomas Portelange Date: Tue, 28 Apr 2020 19:21:52 +0200 Subject: [PATCH 2/2] Update src/Control/Session.php Co-Authored-By: Guy Marriott --- src/Control/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Control/Session.php b/src/Control/Session.php index 5fc0f6c1e..1aeb951ee 100644 --- a/src/Control/Session.php +++ b/src/Control/Session.php @@ -648,7 +648,7 @@ class Session */ public function regenerateSessionId() { - if (!headers_sent() && session_status() == PHP_SESSION_ACTIVE) { + if (!headers_sent() && session_status() === PHP_SESSION_ACTIVE) { session_regenerate_id(true); } }