[HttpFoundation] Fix session::remove() not initializing the session

This commit is contained in:
Jordi Boggiano 2010-09-29 22:20:52 +02:00 committed by Fabien Potencier
parent 568cd57da6
commit d28b9ddcda
1 changed files with 3 additions and 4 deletions

View File

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