From d28b9ddcda3e94cc2418ddb762860421bda2d1be Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 29 Sep 2010 22:20:52 +0200 Subject: [PATCH] [HttpFoundation] Fix session::remove() not initializing the session --- src/Symfony/Component/HttpFoundation/Session.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Session.php b/src/Symfony/Component/HttpFoundation/Session.php index b91fc456ab..e010d80127 100644 --- a/src/Symfony/Component/HttpFoundation/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session.php @@ -150,11 +150,10 @@ class Session implements \Serializable */ public function remove($name) { + if (false === $this->started) { + $this->start(); + } if (array_key_exists($name, $this->attributes)) { - if (false === $this->started) { - $this->start(); - } - unset($this->attributes[$name]); } }