public function expire($name, $path = '/', $domain = null)
    {
        if (null === $path) {
            $path = '/';
        }

        if (empty($domain)) {
            // an empty domain means any domain
            // this should never happen but it allows for a better BC
            $domains = array_keys($this->cookieJar);
        } else {
            $domains = array($domain);
        }

        foreach ($domains as $domain) {
            unset($this->cookieJar[$domain][$path][$name]);

            if (empty($this->cookieJar[$domain][$path])) {
                unset($this->cookieJar[$domain][$path]);

                if (empty($this->cookieJar[$domain])) {
                    unset($this->cookieJar[$domain]);
                }
            }
        }
    }
public function expire($name, $path = '/', $domain = null)
    {
        if (null === $path) {
            $path = '/';
        }

        if (empty($domain)) {
            // an empty domain means any domain
            // this should never happen but it allows for a better BC
            $domains = array_keys($this->cookieJar);
        } else {
            $domains = array($domain);
        }

        foreach ($domains as $domain) {
            unset($this->cookieJar[$domain][$path][$name]);

            if (empty($this->cookieJar[$domain][$path])) {
                unset($this->cookieJar[$domain][$path]);

                if (empty($this->cookieJar[$domain])) {
                    unset($this->cookieJar[$domain]);
                }
            }
        }
    }
public function expire ( $ name , $ path = '/' , $ domain = null ) { if ( null === $ path ) { $ path = '/' ; } if ( empty ( $ domain ) ) { // an empty domain means any domain // this should never happen but it allows for a better BC $ domains = array_keys ( $ this -> cookieJar ) ; } else { $ domains = array ( $ domain ) ; } foreach ( $ domains as $ domain ) { unset ( $ this -> cookieJar [ $ domain ] [ $ path ] [ $ name ] ) ; if ( empty ( $ this -> cookieJar [ $ domain ] [ $ path ] ) ) { unset ( $ this -> cookieJar [ $ domain ] [ $ path ] ) ; if ( empty ( $ this -> cookieJar [ $ domain ] ) ) { unset ( $ this -> cookieJar [ $ domain ] ) ; } } } }
Removes a cookie by name.

You should never use an empty domain, but if you do so,
all cookies for the given name/path expire (this behavior
ensures a BC behavior with previous versions of Symfony).

@param string $name   The cookie name
@param string $path   The cookie path
@param string $domain The cookie domain
Removes a cookie by name .