From 007a46a28fbaba3cc949d3a7e61a08ca8a0e7ed2 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 4 Dec 2022 23:23:06 +0100 Subject: [PATCH] CsrfProtection: used new sessionSection API --- src/Forms/Controls/CsrfProtection.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Forms/Controls/CsrfProtection.php b/src/Forms/Controls/CsrfProtection.php index 769a6d202..46ce91790 100644 --- a/src/Forms/Controls/CsrfProtection.php +++ b/src/Forms/Controls/CsrfProtection.php @@ -73,11 +73,11 @@ public function getToken(): string } $session = $this->session->getSection(self::class); - if (!isset($session->token)) { - $session->token = Nette\Utils\Random::generate(); + if (!$session->get('token')) { + $session->set('token', Nette\Utils\Random::generate()); } - return $session->token ^ $this->session->getId(); + return $session->get('token') ^ $this->session->getId(); }