|
static | fromArray (array $cookies, string $domain) |
| Create a new Cookie jar from an associative array and domain.
|
|
static | shouldPersist (SetCookie $cookie, bool $allowSessionCookies=false) |
| Evaluate if this cookie should be persisted to storage that survives between requests.
|
|
◆ __construct()
GuzzleHttp\Cookie\CookieJar::__construct |
( |
bool | $strictMode = false, |
|
|
array | $cookieArray = [] ) |
- Parameters
-
bool | $strictMode | Set to true to throw exceptions when invalid cookies are added to the cookie jar. |
array | $cookieArray | Array of SetCookie objects or a hash of arrays that can be used with the SetCookie constructor |
◆ clear()
GuzzleHttp\Cookie\CookieJar::clear |
( |
?string | $domain = null, |
|
|
?string | $path = null, |
|
|
?string | $name = null ) |
◆ clearSessionCookies()
GuzzleHttp\Cookie\CookieJar::clearSessionCookies |
( |
| ) |
|
◆ extractCookies()
Extract cookies from an HTTP response and store them in the CookieJar.
- Parameters
-
RequestInterface | $request | Request that was sent |
ResponseInterface | $response | Response that was received |
Implements GuzzleHttp\Cookie\CookieJarInterface.
◆ fromArray()
static GuzzleHttp\Cookie\CookieJar::fromArray |
( |
array | $cookies, |
|
|
string | $domain ) |
|
static |
Create a new Cookie jar from an associative array and domain.
- Parameters
-
array | $cookies | Cookies to create the jar from |
string | $domain | Domain to set the cookies to |
◆ getCookieByName()
GuzzleHttp\Cookie\CookieJar::getCookieByName |
( |
string | $name | ) |
|
Finds and returns the cookie based on the name.
- Parameters
-
string | $name | cookie name to search for |
- Return values
-
SetCookie|null | cookie that was found or null if not found |
◆ getIterator()
GuzzleHttp\Cookie\CookieJar::getIterator |
( |
| ) |
|
- Return values
-
ArrayIterator<int,SetCookie> | |
◆ setCookie()
GuzzleHttp\Cookie\CookieJar::setCookie |
( |
SetCookie | $cookie | ) |
|
◆ shouldPersist()
static GuzzleHttp\Cookie\CookieJar::shouldPersist |
( |
SetCookie | $cookie, |
|
|
bool | $allowSessionCookies = false ) |
|
static |
Evaluate if this cookie should be persisted to storage that survives between requests.
- Parameters
-
SetCookie | $cookie | Being evaluated. |
bool | $allowSessionCookies | If we should persist session cookies |
◆ toArray()
GuzzleHttp\Cookie\CookieJar::toArray |
( |
| ) |
|
◆ withCookieHeader()
Create a request with added cookie headers.
If no matching cookies are found in the cookie jar, then no Cookie header is added to the request and the same request is returned.
- Parameters
-
RequestInterface | $request | Request object to modify. |
- Return values
-
RequestInterface | returns the modified request. |
Implements GuzzleHttp\Cookie\CookieJarInterface.
The documentation for this class was generated from the following file:
- lib/guzzlehttp/guzzle/src/Cookie/CookieJar.php