[HttpFoundation] refactored hasPreviousSession

This commit is contained in:
Tobias Schultze 2012-07-04 03:41:37 +02:00
parent 3ee1b383af
commit 4d0ae1fb0c

View File

@ -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());
}
/**