From 40ffd6802bbbfcbb68320e7621528cd6068b900d Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Wed, 27 Aug 2025 09:53:15 -0400 Subject: [PATCH] fix(http): Adjust session handling in `StatelessApplication` to set session ID from cookies and ensure clean state management. --- src/http/StatelessApplication.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/http/StatelessApplication.php b/src/http/StatelessApplication.php index 6028cc2f..2293e60a 100644 --- a/src/http/StatelessApplication.php +++ b/src/http/StatelessApplication.php @@ -420,14 +420,10 @@ protected function reset(ServerRequestInterface $request): void $this->response->cookieValidationKey = $this->request->cookieValidationKey; $this->response->enableCookieValidation = $this->request->enableCookieValidation; - // reset the session to ensure a clean state - $this->session->close(); + // if a session cookie is present, set the session ID accordingly $sessionId = $this->request->getCookies()->get($this->session->getName())->value ?? ''; $this->session->setId($sessionId); - // start the session with the correct 'ID' - $this->session->open(); - $this->bootstrap(); $this->session->close();