Skip to content

Commit

Permalink
Skip regenerate if session is not active
Browse files Browse the repository at this point in the history
  • Loading branch information
alextselegidis committed May 22, 2024
1 parent 1f17ae6 commit af2e3a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions system/libraries/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit af2e3a0

Please sign in to comment.