diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index df021f0919..b868bd912c 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -526,7 +526,7 @@ class Request */ public function hasSession() { - return null !== $this->session && $this->session->isStarted(); + return null !== $this->session; } /** diff --git a/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php b/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php index e84590b42e..a4d5dccf49 100644 --- a/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php +++ b/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php @@ -177,13 +177,11 @@ interface SessionInterface function clear(); /** - * Check if a session was started + * Checks if the session was started. * - * @api - * - * @return boolean + * @return Boolean */ - public function isStarted(); + function isStarted(); /** * Registers a SessionBagInterface with the session. diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php index a49e54b56f..b18d071d95 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php @@ -205,9 +205,7 @@ class MockArraySessionStorage implements SessionStorageInterface } /** - * Check if the session was started or not - * - * @return boolean + * {@inheritdoc} */ public function isStarted() { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php index b401dda197..ec753ec0de 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -290,9 +290,7 @@ class NativeSessionStorage implements SessionStorageInterface } /** - * Check if the session was started or not - * - * @return boolean + * {@inheritdoc} */ public function isStarted() { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php b/src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php index c07ed7fb6f..0673d97a14 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php @@ -35,6 +35,13 @@ interface SessionStorageInterface */ function start(); + /** + * Checks if the session is started. + * + * @return boolean True if started, false otherwise. + */ + function isStarted(); + /** * Returns the session ID * diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php index 8157acf7bf..9a847554b3 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -949,7 +949,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase $this->assertFalse($request->hasSession()); $request->setSession(new Session(new MockArraySessionStorage())); - $request->getSession()->start(); $this->assertTrue($request->hasSession()); } @@ -961,7 +960,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase $request->cookies->set('MOCKSESSID', 'foo'); $this->assertFalse($request->hasPreviousSession()); $request->setSession(new Session(new MockArraySessionStorage())); - $request->getSession()->start(); $this->assertTrue($request->hasPreviousSession()); } diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php index d6723785ee..646ed2357a 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php @@ -85,7 +85,6 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase protected function runSessionOnKernelResponse($newToken, $original = null) { $session = new Session(new MockArraySessionStorage()); - $session->start(); if ($original !== null) { $session->set('_security_session', $original);