diff --git a/.idea/simple-php-router.iml b/.idea/simple-php-router.iml index e5bc18a..f342345 100644 --- a/.idea/simple-php-router.iml +++ b/.idea/simple-php-router.iml @@ -2,7 +2,9 @@ + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 84f9914..f60b995 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,8 +5,9 @@ + - + - diff --git a/src/Pecee/Http/Security/CookieTokenProvider.php b/src/Pecee/Http/Security/CookieTokenProvider.php index c078faa..35f1021 100644 --- a/src/Pecee/Http/Security/CookieTokenProvider.php +++ b/src/Pecee/Http/Security/CookieTokenProvider.php @@ -17,7 +17,7 @@ class CookieTokenProvider implements ITokenProvider */ public function __construct() { - $this->token = $this->getToken(); + $this->token = ($this->hasToken() === true) ? $_COOKIE[static::CSRF_KEY] : null; if ($this->token === null) { $this->token = $this->generateToken(); @@ -73,8 +73,6 @@ class CookieTokenProvider implements ITokenProvider */ public function getToken(?string $defaultValue = null): ?string { - $this->token = ($this->hasToken() === true) ? $_COOKIE[static::CSRF_KEY] : null; - return $this->token ?? $defaultValue; }