Set-Cookie object
- Implements
Stringable
Methods |
public __construct(array $data = [])
|
public __toString() : string |
public static fromString(string $cookie) : self Create a new SetCookie object from a string.
|
public getDiscard() Get whether or not this is a session cookie.
|
public getDomain() Get the domain.
|
public getExpires() The UNIX timestamp when the cookie Expires.
|
public getHttpOnly() Get whether or not this is an HTTP only cookie.
|
public getMaxAge() Maximum lifetime of the cookie in seconds.
|
public getName() Get the cookie name.
|
public getPath() Get the path.
|
public getSecure() Get whether or not this is a secure cookie.
|
public getValue() Get the cookie value.
|
public isExpired() : bool Check if the cookie is expired. |
public matchesDomain(string $domain) : bool Check if the cookie matches a domain value.
|
public matchesPath(string $requestPath) : bool Check if the cookie matches a path value. A request-path path-matches a given cookie-path if at least one of the following conditions holds:
|
public setDiscard( $discard) : void Set whether or not this is a session cookie.
|
public setDomain( $domain) : void Set the domain of the cookie.
|
public setExpires( $timestamp) : void Set the unix timestamp for which the cookie will expire.
|
public setHttpOnly( $httpOnly) : void Set whether or not this is an HTTP only cookie.
|
public setMaxAge( $maxAge) : void Set the max-age of the cookie.
|
public setName( $name) : void Set the cookie name.
|
public setPath( $path) : void Set the path of the cookie.
|
public setSecure( $secure) : void Set whether or not the cookie is secure.
|
public setValue( $value) : void Set the cookie value.
|
public toArray() : array |
public validate() Check if the cookie is valid according to RFC 6265.
|
Properties |
private $data = NULL
|
private static $defaults = ['Name' => NULL, 'Value' => NULL, 'Domain' => NULL, 'Path' => '/', 'Max-Age' => NULL, 'Expires' => NULL, 'Secure' => false, 'Discard' => false, 'HttpOnly' => false]
|
Properties |
private static $defaults = ['Name' => NULL, 'Value' => NULL, 'Domain' => NULL, 'Path' => '/', 'Max-Age' => NULL, 'Expires' => NULL, 'Secure' => false, 'Discard' => false, 'HttpOnly' => false]
|
Methods |
public static fromString(string $cookie) : self Create a new SetCookie object from a string.
|