diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index afab299767..0cc341fc3b 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -546,9 +546,7 @@ class Request public function hasPreviousSession() { // the check for $this->session avoids malicious users trying to fake a session cookie with proper name - $sessionName = $this->hasSession() ? $this->session->getName() : null; - - return $this->cookies->has($sessionName) && $this->hasSession(); + return $this->hasSession() && $this->cookies->has($this->session->getName()); } /**