From e571fe6e584b9f8f82d4c54dbed75b28d2381004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20I=C5=BCewski?= <50335909+michal-izewski@users.noreply.github.com> Date: Tue, 7 May 2024 16:54:11 +0200 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: George Steel Signed-off-by: Michał Iżewski <50335909+michal-izewski@users.noreply.github.com> --- src/CacheSessionPersistence.php | 2 +- test/CacheSessionPersistenceIntegrationTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CacheSessionPersistence.php b/src/CacheSessionPersistence.php index 0183a48..13f3c27 100644 --- a/src/CacheSessionPersistence.php +++ b/src/CacheSessionPersistence.php @@ -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); } diff --git a/test/CacheSessionPersistenceIntegrationTest.php b/test/CacheSessionPersistenceIntegrationTest.php index 388b5ea..e56b491 100644 --- a/test/CacheSessionPersistenceIntegrationTest.php +++ b/test/CacheSessionPersistenceIntegrationTest.php @@ -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,