\Zend\Http\Header\Exception\InvalidArgumentException
see \Zend\Http\Header\http://www.ietf.org/rfc/rfc2109.txt
see \Zend\Http\Header\http://www.w3.org/Protocols/rfc2109/rfc2109

 Methods

Cookie object constructor

__construct(string $name, string $value, int | string $expires, string $path, string $domain, bool $secure, bool $httponly, string $maxAge, int $version) : \Zend\Http\Header\SetCookie

todo Add validation of each one of the parameters (legal domain, etc.)

Parameters

$name

string

$value

string

$expires

intstring

$path

string

$domain

string

$secure

bool

$httponly

bool

$maxAge

string

$version

int

Returns

fromString()

fromString($headerLine, bool $bypassHeaderFieldName) : array | \Zend\Http\Header\SetCookie

static

Parameters

$headerLine

$bypassHeaderFieldName

bool

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException

Returns

getDomain()

getDomain() : string

Returns

string

getExpires()

getExpires(bool $inSeconds) : int | string

Parameters

$inSeconds

bool

Returns

intstring

getFieldName()

getFieldName() : string

Returns

string'Set-Cookie'

getFieldValue()

getFieldValue() : string

Get Max-Age

getMaxAge() : int

Returns

int

getName()

getName() : string

Returns

string

getPath()

getPath() : string

Returns

string

getValue()

getValue() : string

Returns

string

Get version

getVersion() : int

Returns

int

Check whether the cookie is a session cookie (has no expiry time set)

hasQuoteFieldValue() : bool

Returns

bool

Check whether the cookie has expired

isExpired(int $now) : bool

Always returns false if the cookie is a session cookie (has no expiry time)

Parameters

$now

int

Timestamp to consider as "now"

Returns

bool

isHttponly()

isHttponly() : bool

Returns

bool

isSecure()

isSecure() : bool

Returns

bool

Check whether the cookie is a session cookie (has no expiry time set)

isSessionCookie() : bool

Returns

bool

isValidForRequest()

isValidForRequest($requestDomain, $path, $isSecure) 

Parameters

$requestDomain

$path

$isSecure

Checks whether the cookie should be sent or not in a specific scenario

match(string | \Zend\Http\Header\Zend\Uri\Uri $uri, bool $matchSessionCookies, int $now) : bool

Parameters

$uri

string\Zend\Http\Header\Zend\Uri\Uri

URI to check against (secure, domain, path)

$matchSessionCookies

bool

Whether to send session cookies

$now

int

Override the current time when checking for expiry time

Returns

bool

Check if a cookie's domain matches a host name.

matchCookieDomain(string $cookieDomain, string $host) : bool

Used by Zend\Http\Cookies for cookie matching

Parameters

$cookieDomain

string

$host

string

Returns

bool

Check if a cookie's path matches a URL path

matchCookiePath(string $cookiePath, string $path) : bool

Used by Zend\Http\Cookies for cookie matching

Parameters

$cookiePath

string

$path

string

Returns

bool

setDomain()

setDomain(string $domain) : \Zend\Http\Header\SetCookie

Parameters

$domain

string

Returns

setExpires()

setExpires(int | string $expires) : \Zend\Http\Header\SetCookie

setHttponly()

setHttponly(bool $httponly) : \Zend\Http\Header\SetCookie

Parameters

$httponly

bool

Returns

Set Max-Age

setMaxAge(int $maxAge) : \Zend\Http\Header\SetCookie

setName()

setName(string $name) : \Zend\Http\Header\SetCookie

setPath()

setPath(string $path) : \Zend\Http\Header\SetCookie

Parameters

$path

string

Returns

setQuoteFieldValue()

setQuoteFieldValue(bool $quotedValue) : \Zend\Http\Header\SetCookie

Parameters

$quotedValue

bool

Returns

setSecure()

setSecure(bool $secure) : \Zend\Http\Header\SetCookie

Parameters

$secure

bool

Returns

setValue()

setValue(string $value) : \Zend\Http\Header\SetCookie

Parameters

$value

string

Returns

Set version

setVersion(int $version) : \Zend\Http\Header\SetCookie

toString()

toString() 

toStringMultipleHeaders()

toStringMultipleHeaders(array $headers) 

Parameters

$headers

 Properties

 

Cookie domain

$domain : string | null

 

Cookie expiry date

$expires : int | null

 

$httponly

$httponly : bool | null

 

Max Age

$maxAge : int | null

 

Cookie name

$name : string | null

 

Cookie path

$path : string | null

 

If the value need to be quoted or not

$quoteFieldValue : bool

 

Whether the cookie is secure or not

$secure : bool | null

 

Cookie value

$value : string | null

 

Version

$version : int | null