Skip to content

Commit

Permalink
Do not forcibly regenerate the session when session data changes
Browse files Browse the repository at this point in the history
This is the responsibility of upper layers.

Closes: mezzio#43

Signed-off-by: Roel van Meer <[email protected]>
  • Loading branch information
rvm-peercode committed Oct 4, 2023
1 parent e50ab7e commit 965ba68
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/CacheSessionPersistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ public function persistSession(SessionInterface $session, ResponseInterface $res
// Regenerate the session if:
// - we have no session identifier
// - the session is marked as regenerated
// - the session has changed (data is different)
if ('' === $id || $session->isRegenerated() || $session->hasChanged()) {
if ('' === $id || $session->isRegenerated()) {
$id = $this->regenerateSession($id);
}

Expand Down

0 comments on commit 965ba68

Please sign in to comment.