CookieJar
class CookieJar (View source)
Constants
| SAME_LAX |
|
| SAME_NONE |
|
| SAME_STRICT |
|
| DISALLOW_NAME_CHARS |
|
| DISALLOW_VALUE_CHARS |
|
| DELETE |
|
| DELIMITER |
|
Methods
No description
Defines the host to which the cookie will be sent.
Indicates the path that must exist in the requested URL for the browser to send the Cookie header.
Indicates the maximum lifetime of the cookies.
Forbids JavaScript from accessing the cookie, for example,
through the Document.cookie property.
Indicates that the cookie should be stored using partitioned storage.
Controls whether or not a cookie is sent with cross-site requests.
Indicates that the cookie is sent to the server only when a request is made with the https scheme (except on localhost), and therefore, is more resistant to man-in-the-middle attacks.
Magic method for get property value from jar
Magic method for set or remove cookie jar properties
Magic method for check if variable is setted
Send cookies from jar to headers
Details
__construct(string $jar)
No description
setDomain(string $domain)
Defines the host to which the cookie will be sent.
Note: Contrary to earlier specifications, leading
dots in domain names (.example.com) are ignored.
setPath(string $path)
Indicates the path that must exist in the requested URL for the browser to send the Cookie header.
setExpires(string $datetime)
Indicates the maximum lifetime of the cookies.
Note: Accept English textual datetime descriptions (e.g., '+1 day', 'last Monday').
setHttpOnly(bool $enable)
Forbids JavaScript from accessing the cookie, for example,
through the Document.cookie property.
setPartitioned(bool $enable)
Indicates that the cookie should be stored using partitioned storage.
Note that if this is set, the Secure directive must also be set.
setSameSite(int $mode)
Controls whether or not a cookie is sent with cross-site requests.
setSecure(bool $enable)
Indicates that the cookie is sent to the server only when a request is made with the https scheme (except on localhost), and therefore, is more resistant to man-in-the-middle attacks.
mixed
__get(string $name)
Magic method for get property value from jar
__set(string $name, string|null $value)
Magic method for set or remove cookie jar properties
bool
__isset(string $name)
Magic method for check if variable is setted
send()
Send cookies from jar to headers