Class SetCookie

Summary

Fully Qualified Name: Zend\Http\Header\SetCookie
Implements: MultipleHeaderInterface

Description

Methods

Name Description Defined By
__construct() Cookie object constructor SetCookie
fromString() SetCookie
getDomain() SetCookie
getEncodeValue() SetCookie
getExpires() SetCookie
getFieldName() SetCookie
getFieldValue() SetCookie
getMaxAge() Get Max-Age SetCookie
getName() SetCookie
getPath() SetCookie
getValue() SetCookie
getVersion() Get version SetCookie
hasQuoteFieldValue() Check whether the value for this cookie should be quoted SetCookie
isExpired() Check whether the cookie has expired SetCookie
isHttponly() SetCookie
isSecure() SetCookie
isSessionCookie() Check whether the cookie is a session cookie (has no expiry time set) SetCookie
isValidForRequest() SetCookie
match() Checks whether the cookie should be sent or not in a specific scenario SetCookie
matchCookieDomain() Check if a cookie's domain matches a host name. SetCookie
matchCookiePath() Check if a cookie's path matches a URL path SetCookie
setDomain() SetCookie
setEncodeValue() SetCookie
setExpires() Set Expires SetCookie
setHttponly() SetCookie
setMaxAge() Set Max-Age SetCookie
setName() SetCookie
setPath() SetCookie
setQuoteFieldValue() Set whether the value for this cookie should be quoted SetCookie
setSecure() SetCookie
setValue() SetCookie
setVersion() Set version SetCookie
toString() SetCookie
toStringMultipleHeaders() SetCookie

Method Details

__construct()

Cookie object constructor

Parameter Name Type Description
$name string
$value string
$expires int|string|\DateTime
$path string
$domain string
$secure bool
$httponly bool
$maxAge string
$version int

Returns:

fromString()

Parameter Name Type Description
$headerLine
$bypassHeaderFieldName bool
$headerLine

Returns: array|\SetCookie

getDomain()

Returns: string

getEncodeValue()

Returns: bool

getExpires()

Parameter Name Type Description
$inSeconds bool

Returns: int|string

getFieldName()

Returns: string 'Set-Cookie'

getFieldValue()

Returns: string

getMaxAge()

Get Max-Age

Returns: int

getName()

Returns: string

getPath()

Returns: string

getValue()

Returns: string

getVersion()

Get version

Returns: int

hasQuoteFieldValue()

Check whether the value for this cookie should be quoted

Returns: bool

isExpired()

Check whether the cookie has expired

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

Parameter Name Type Description
$now int Timestamp

Returns: bool

isHttponly()

Returns: bool

isSecure()

Returns: bool

isSessionCookie()

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

Returns: bool

isValidForRequest()

Parameter Name Type Description
$requestDomain
$path
$isSecure

Returns: void

match()

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

Parameter Name Type Description
$uri string|\Zend\Uri\Uri URI
$matchSessionCookies bool Whether
$now int Override

Returns: bool

matchCookieDomain()

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

Used by Zend\Http\Cookies for cookie matching

Parameter Name Type Description
$cookieDomain string
$host string

Returns: bool

matchCookiePath()

Check if a cookie's path matches a URL path

Used by Zend\Http\Cookies for cookie matching

Parameter Name Type Description
$cookiePath string
$path string

Returns: bool

setDomain()

Parameter Name Type Description
$domain string

Returns: \SetCookie

setEncodeValue()

Parameter Name Type Description
$encodeValue bool

Returns:

setExpires()

Set Expires

Parameter Name Type Description
$expires int|string|\DateTime

Returns: self

setHttponly()

Parameter Name Type Description
$httponly bool

Returns: \SetCookie

setMaxAge()

Set Max-Age

Parameter Name Type Description
$maxAge int

Returns: \SetCookie

setName()

Parameter Name Type Description
$name string

Returns: \SetCookie

setPath()

Parameter Name Type Description
$path string

Returns: \SetCookie

setQuoteFieldValue()

Set whether the value for this cookie should be quoted

Parameter Name Type Description
$quotedValue bool

Returns: \SetCookie

setSecure()

Parameter Name Type Description
$secure bool

Returns: \SetCookie

setValue()

Parameter Name Type Description
$value string

Returns: \SetCookie

setVersion()

Set version

Parameter Name Type Description
$version int

Returns: \SetCookie

toString()

Returns: void

toStringMultipleHeaders()

Parameter Name Type Description
$headers

Returns: void

Top