diff --git a/src/Symfony/Component/HttpFoundation/Session/Session.php b/src/Symfony/Component/HttpFoundation/Session/Session.php index fde54531e2..63dda8d6bd 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session/Session.php @@ -151,33 +151,6 @@ class Session implements SessionInterface return $this->storage->getId(); } - /** - * Implements the \Serialize interface. - * - * @return string - */ - public function serialize() - { - return serialize($this->storage); - } - - /** - * Implements the \Serialize interface. - * - * @param string $serialized - * - * @throws \InvalidArgumentException If the passed string does not unserialize to an instance of SessionStorageInterface - */ - public function unserialize($serialized) - { - $storage = unserialize($serialized); - if (!$storage instanceof SessionStorageInterface) { - throw new \InvalidArgumentException('Serialized data did not return a valid instance of SessionStorageInterface'); - } - - $this->storage = $storage; - } - /** * Registers a SessionBagInterface with the sessio. * diff --git a/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php b/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php index ffa7105068..741969b10e 100644 --- a/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php +++ b/src/Symfony/Component/HttpFoundation/Session/SessionInterface.php @@ -16,7 +16,7 @@ namespace Symfony\Component\HttpFoundation\Session; * * @author Drak */ -interface SessionInterface extends \Serializable +interface SessionInterface { /** * Starts the session storage. diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Session/SessionTest.php b/tests/Symfony/Tests/Component/HttpFoundation/Session/SessionTest.php index a7f91692ea..20f5079150 100644 --- a/tests/Symfony/Tests/Component/HttpFoundation/Session/SessionTest.php +++ b/tests/Symfony/Tests/Component/HttpFoundation/Session/SessionTest.php @@ -139,29 +139,6 @@ class SessionTest extends \PHPUnit_Framework_TestCase $this->assertEquals(333, $this->session->get('migrate')); } - public function testSerialize() - { - $compare = serialize($this->storage); - - $this->assertSame($compare, $this->session->serialize()); - - $this->session->unserialize($compare); - - $_storage = new \ReflectionProperty(get_class($this->session), 'storage'); - $_storage->setAccessible(true); - - $this->assertEquals($_storage->getValue($this->session), $this->storage, 'storage match'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testUnserializeException() - { - $serialized = serialize(new \ArrayObject()); - $this->session->unserialize($serialized); - } - public function testGetId() { $this->assertEquals('', $this->session->getId());