diff --git a/src/Symfony/Component/Security/Core/Authentication/RememberMe/CacheTokenVerifier.php b/src/Symfony/Component/Security/Core/Authentication/RememberMe/CacheTokenVerifier.php index dabc719055fcf..340bc87c2e32e 100644 --- a/src/Symfony/Component/Security/Core/Authentication/RememberMe/CacheTokenVerifier.php +++ b/src/Symfony/Component/Security/Core/Authentication/RememberMe/CacheTokenVerifier.php @@ -45,11 +45,11 @@ public function verifyToken(PersistentTokenInterface $token, string $tokenValue) } $cacheKey = $this->getCacheKey($token); - if (!$this->cache->hasItem($cacheKey)) { + $item = $this->cache->getItem($cacheKey); + if (!$item->isHit()) { return false; } - $item = $this->cache->getItem($cacheKey); $outdatedToken = $item->get(); return hash_equals($outdatedToken, $tokenValue);