Symfony\Component\BrowserKit\Cookie::__toString PHP Метод

__toString() публичный Метод

Returns the HTTP representation of the Cookie.
public __toString ( ) : string
Результат string The HTTP representation of the Cookie
    public function __toString()
    {
        $cookie = sprintf('%s=%s', $this->name, $this->rawValue);

        if (null !== $this->expires) {
            $cookie .= '; expires='.substr(\DateTime::createFromFormat('U', $this->expires, new \DateTimeZone('UTC'))->format(static::DATE_FORMAT), 0, -5);
        }

        if ('' !== $this->domain) {
            $cookie .= '; domain='.$this->domain;
        }

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

        if ($this->secure) {
            $cookie .= '; secure';
        }

        if ($this->httponly) {
            $cookie .= '; httponly';
        }

        return $cookie;
    }