We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0121c0 commit a91c42dCopy full SHA for a91c42d
src/Guard.php
@@ -192,7 +192,7 @@ public function validateStorage()
192
if (!isset($_SESSION)) {
193
throw new RuntimeException('CSRF middleware failed. Session not found.');
194
}
195
- if (!array_key_exists($this->prefix, $_SESSION)) {
+ if (!array_key_exists($this->prefix, $_SESSION) || !\is_array($_SESSION[$this->prefix])) {
196
$_SESSION[$this->prefix] = [];
197
198
$this->storage = &$_SESSION[$this->prefix];
0 commit comments