Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: George Steel <[email protected]>
Signed-off-by: Michał Iżewski <[email protected]>
  • Loading branch information
michal-izewski and gsteel authored May 7, 2024
1 parent 9a76d8c commit e571fe6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CacheSessionPersistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,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) and autoRegenerate is turned off in the configuration
// - the session has changed (data is different) and autoRegenerate is turned on (default) in the configuration
if ('' === $id || $session->isRegenerated() || ($this->autoRegenerate && $session->hasChanged())) {
$id = $this->regenerateSession($id);
}
Expand Down
2 changes: 1 addition & 1 deletion test/CacheSessionPersistenceIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function testThatAChangedSessionWillCauseRegenerationAndASetCookieHeader(
self::assertNull($value, 'The previous session data should have been deleted');
}

public function testThatAChangedSessionWillNotCauseRegenerationAndASetCookieHeader(): void
public function testThatAChangedSessionWillNotCauseRegenerationWhenAutoRegenerateIsFalse(): void
{
$this->storage = new CacheSessionPersistence(
$this->cache,
Expand Down

0 comments on commit e571fe6

Please sign in to comment.