Skip to content

Commit a91c42d

Browse files
committed
Backport [ecd1f26]
1 parent b0121c0 commit a91c42d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Guard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function validateStorage()
192192
if (!isset($_SESSION)) {
193193
throw new RuntimeException('CSRF middleware failed. Session not found.');
194194
}
195-
if (!array_key_exists($this->prefix, $_SESSION)) {
195+
if (!array_key_exists($this->prefix, $_SESSION) || !\is_array($_SESSION[$this->prefix])) {
196196
$_SESSION[$this->prefix] = [];
197197
}
198198
$this->storage = &$_SESSION[$this->prefix];

0 commit comments

Comments
 (0)