889. Class

889.1. Zend\Http\Header\SetCookie

@throws ExceptionInvalidArgumentException

889.1.1. Methods

889.1.1.1. fromString

fromString()

@static

Parameters:
  • $headerLine
  • bool
Return type:

array|SetCookie

889.1.1.2. __construct

__construct()

Cookie object constructor

Parameters:
  • string
  • string
  • int
  • string
  • string
  • bool
  • bool
  • string
  • int
Return type:

SetCookie

889.1.1.3. getFieldName

getFieldName()

@return string ‘Set-Cookie’

889.1.1.4. getFieldValue

getFieldValue()

@throws ExceptionRuntimeException

Return type:string

889.1.1.5. setName

setName()

@param string $name

Return type:SetCookie

889.1.1.6. getName

getName()

@return string

889.1.1.7. setValue

setValue()

@param string $value

889.1.1.8. getValue

getValue()

@return string

889.1.1.9. setVersion

setVersion()

Set version

Parameters:integer
Throws ExceptionInvalidArgumentException:
 

889.1.1.10. getVersion

getVersion()

Get version

Return type:integer

889.1.1.11. setMaxAge

setMaxAge()

Set Max-Age

Parameters:integer
Throws ExceptionInvalidArgumentException:
 

889.1.1.12. getMaxAge

getMaxAge()

Get Max-Age

Return type:integer

889.1.1.13. setExpires

setExpires()

@param int $expires

Return type:SetCookie

889.1.1.14. getExpires

getExpires()

@param bool $inSeconds

Return type:int

889.1.1.15. setDomain

setDomain()

@param string $domain

889.1.1.16. getDomain

getDomain()

@return string

889.1.1.17. setPath

setPath()

@param string $path

889.1.1.18. getPath

getPath()

@return string

889.1.1.19. setSecure

setSecure()

@param bool $secure

889.1.1.20. isSecure

isSecure()

@return bool

889.1.1.21. setHttponly

setHttponly()

@param bool $httponly

889.1.1.22. isHttponly

isHttponly()

@return bool

889.1.1.23. isExpired

isExpired()

Check whether the cookie has expired

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

Parameters:int – Timestamp to consider as “now”
Return type:bool

889.1.1.24. isSessionCookie

isSessionCookie()

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

Return type:bool

889.1.1.25. isValidForRequest

isValidForRequest()

889.1.1.26. match

match()

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

Parameters:
  • string|ZendUriUri – URI to check against (secure, domain, path)
  • boolean – Whether to send session cookies
  • int – Override the current time when checking for expiry time
Return type:

boolean

889.1.1.27. matchCookieDomain

matchCookieDomain()

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

Used by ZendHttpCookies for cookie matching

Parameters:
  • string
  • string
Return type:

boolean

889.1.1.28. matchCookiePath

matchCookiePath()

Check if a cookie’s path matches a URL path

Used by ZendHttpCookies for cookie matching

Parameters:
  • string
  • string
Return type:

boolean

889.1.1.29. toString

toString()

889.1.1.30. toStringMultipleHeaders

toStringMultipleHeaders()