Skip to content

Commit 0b2beed

Browse files
fix(cache): handle missing session in index for CacheSessionHandler
Improves `read()` logic in CacheSessionHandler to gracefully handle cases where the session is cleared or missing in the session index.
1 parent e7ab8a9 commit 0b2beed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Session/CacheSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(
2727
public function read(string $sessionId): string|false
2828
{
2929
$session = $this->cache->get($sessionId, false);
30-
if ($session === false) {
30+
if ($session === false || !isset($this->sessionIndex[$sessionId])) {
3131
return false;
3232
}
3333

0 commit comments

Comments
 (0)