Skip to content

Commit

Permalink
CsrfProtection: used new sessionSection API
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 5, 2023
1 parent b2b7fc8 commit 007a46a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Forms/Controls/CsrfProtection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}


Expand Down

0 comments on commit 007a46a

Please sign in to comment.