CookieJar
class CookieJar (View source)
A class that holds operations performed on both request and response cookies.
To work only on request cookies, use the Request class. To work only on response cookies, use the ResponseCookieJar class.
Properties
protected Request | $request | The object containing the request cookies. |
|
protected ResponseCookieJar | $responseCookies | The object containing the response cookies. |
Methods
Get the object containing the response cookies.
Does a cookie exist in the request or response cookies?
Get the value of a cookie (from response or from request) given its name.
Get a list of cookie names and values (both from response and from request).
No description
Get the request for this cookie jar.
Details
__construct(Request $request, ResponseCookieJar $responseCookies)
Initialize the instance.
ResponseCookieJar
getResponseCookies()
Get the object containing the response cookies.
bool
has(string $name)
Does a cookie exist in the request or response cookies?
mixed
get(string $name, mixed $default = null)
Get the value of a cookie (from response or from request) given its name.
array
getAll()
Get a list of cookie names and values (both from response and from request).
setRequest(Request $request)
Set the request for this cookie jar.
Cookie
set(string $name, string|null $value = null, int $expire = 0, string $path = '/', null|string $domain = null, bool|null $secure = null, bool $httpOnly = true)
deprecated
deprecated
No description
add(Cookie $cookie)
deprecated
deprecated
No description
clear(string $name)
deprecated
deprecated
No description
Cookie[]
getCookies()
deprecated
deprecated
No description
protected Request
getRequest()
Get the request for this cookie jar.