diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 151861340f..37b7ed4f24 100644 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -693,6 +693,10 @@ public function sess_destroy() */ 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);