Skip to content

Commit

Permalink
Check if session is active before destroying it
Browse files Browse the repository at this point in the history
Fixes #600
  • Loading branch information
Davilarek committed Jul 19, 2024
1 parent 4facfb9 commit b4f3182
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Util/SessionWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ public function destroy() : void
);
}

session_destroy();
session_regenerate_id();
if (session_status() === PHP_SESSION_ACTIVE) {
session_destroy();
session_regenerate_id();
}
}

public function find(string $key) : mixed
Expand Down

0 comments on commit b4f3182

Please sign in to comment.