Skip to content

Commit

Permalink
[HttpFoundation] removed the possibility for a cookie path to set it …
Browse files Browse the repository at this point in the history
…to null (as this is equivalent to /)
  • Loading branch information
fabpot committed Sep 28, 2011
1 parent ffdd667 commit 1e7e6ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpFoundation/Cookie.php
Expand Up @@ -90,7 +90,7 @@ public function __toString()
}
}

if (null !== $this->getPath()) {
if ('/' !== $this->getPath()) {
$str .= '; path='.$this->getPath();
}

Expand Down Expand Up @@ -166,7 +166,7 @@ public function getExpiresTime()
*/
public function getPath()
{
return $this->path;
return null === $this->path ? '/' : $this->path;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php
Expand Up @@ -141,6 +141,10 @@ public function setCookie(Cookie $cookie)
*/
public function removeCookie($name, $path = '/', $domain = null)
{
if (null === $path) {
$path = '/';
}

unset($this->cookies[$domain][$path][$name]);

if (empty($this->cookies[$domain][$path])) {
Expand Down

0 comments on commit 1e7e6ba

Please sign in to comment.