From af2e3a065f07ccc02d1588f4c4be3e54c0d3e833 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 22 May 2024 11:18:22 +0200 Subject: [PATCH] Skip regenerate if session is not active --- system/libraries/Session/Session.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 15186134..37b7ed4f 100644 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -693,6 +693,10 @@ class CI_Session { */ public function sess_regenerate($destroy = null) { + if (@session_status() !== PHP_SESSION_ACTIVE) { + return; + } + $destroy = boolval($destroy !== null ? $destroy : config_item('sess_regenerate_destroy')); $_SESSION['__ci_last_regenerate'] = time(); @session_regenerate_id($destroy);