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

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

Sets a cookie.
public __construct ( string $name, string $value, string $expires = null, string $path = null, string $domain = '', boolean $secure = false, boolean $httponly = true, boolean $encodedValue = false )
$name string The cookie name
$value string The value of the cookie
$expires string The time the cookie expires
$path string The path on the server in which the cookie will be available on
$domain string The domain that the cookie is available
$secure boolean Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client
$httponly boolean The cookie httponly flag
$encodedValue boolean Whether the value is encoded or not
    public function __construct($name, $value, $expires = null, $path = null, $domain = '', $secure = false, $httponly = true, $encodedValue = false)
    {
        if ($encodedValue) {
            $this->value    = urldecode($value);
            $this->rawValue = $value;
        } else {
            $this->value    = $value;
            $this->rawValue = urlencode($value);
        }
        $this->name     = $name;
        $this->expires  = null === $expires ? null : (integer) $expires;
        $this->path     = empty($path) ? null : $path;
        $this->domain   = $domain;
        $this->secure   = (Boolean) $secure;
        $this->httponly = (Boolean) $httponly;
    }