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]); } }