|
Open Journal Systems
3.3.0
|
Public Member Functions | |
| __construct ($strictMode=false, $cookieArray=[]) | |
| clear ($domain=null, $path=null, $name=null) | |
| clearSessionCookies () | |
| count () | |
| extractCookies (RequestInterface $request, ResponseInterface $response) | |
| getCookieByName ($name) | |
| getIterator () | |
| setCookie (SetCookie $cookie) | |
| toArray () | |
| withCookieHeader (RequestInterface $request) | |
Static Public Member Functions | |
| static | fromArray (array $cookies, $domain) |
| static | getCookieValue ($value) |
| static | shouldPersist (SetCookie $cookie, $allowSessionCookies=false) |
Cookie jar that stores cookies as an array
Definition at line 10 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
| GuzzleHttp\Cookie\CookieJar::__construct | ( | $strictMode = false, |
|
$cookieArray = [] |
|||
| ) |
| 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 |
Reimplemented in GuzzleHttp\Cookie\SessionCookieJar, and GuzzleHttp\Cookie\FileCookieJar.
Definition at line 31 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
References GuzzleHttp\Cookie\CookieJar\setCookie().
| GuzzleHttp\Cookie\CookieJar::clear | ( | $domain = null, |
|
$path = null, |
|||
$name = null |
|||
| ) |
Remove cookies currently held in the cookie jar.
Invoking this method without arguments will empty the whole cookie jar. If given a $domain argument only cookies belonging to that domain will be removed. If given a $domain and $path argument, cookies belonging to the specified path within that domain are removed. If given all three arguments, then the cookie with the specified name, path and domain is removed.
| string | null | $domain | Clears cookies matching a domain |
| string | null | $path | Clears cookies matching a domain and path |
| string | null | $name | Clears cookies matching a domain, path, and name |
Implements GuzzleHttp\Cookie\CookieJarInterface.
Definition at line 123 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
References GuzzleHttp\Cookie\SetCookie\getName(), GuzzleHttp\Cookie\SetCookie\matchesDomain(), and GuzzleHttp\Cookie\SetCookie\matchesPath().
| GuzzleHttp\Cookie\CookieJar::clearSessionCookies | ( | ) |
Discard all sessions cookies.
Removes cookies that don't have an expire field or a have a discard field set to true. To be called when the user agent shuts down according to RFC 2965.
Implements GuzzleHttp\Cookie\CookieJarInterface.
Definition at line 155 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
References GuzzleHttp\Cookie\SetCookie\getDiscard(), and GuzzleHttp\Cookie\SetCookie\getExpires().
| GuzzleHttp\Cookie\CookieJar::count | ( | ) |
Definition at line 226 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
| GuzzleHttp\Cookie\CookieJar::extractCookies | ( | RequestInterface | $request, |
| ResponseInterface | $response | ||
| ) |
Extract cookies from an HTTP response and store them in the CookieJar.
| RequestInterface | $request | Request that was sent |
| ResponseInterface | $response | Response that was received |
Implements GuzzleHttp\Cookie\CookieJarInterface.
Definition at line 236 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
References GuzzleHttp\Cookie\SetCookie\fromString(), Psr\Http\Message\RequestInterface\getUri(), and GuzzleHttp\Cookie\CookieJar\setCookie().
|
static |
Create a new Cookie jar from an associative array and domain.
| array | $cookies | Cookies to create the jar from |
| string | $domain | Domain to set the cookies to |
Definition at line 51 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
| GuzzleHttp\Cookie\CookieJar::getCookieByName | ( | $name | ) |
Finds and returns the cookie based on the name
| string | $name | cookie name to search for |
Definition at line 101 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
|
static |
Definition at line 69 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
| GuzzleHttp\Cookie\CookieJar::getIterator | ( | ) |
Definition at line 231 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
Referenced by GuzzleHttp\Cookie\CookieJar\toArray().
| GuzzleHttp\Cookie\CookieJar::setCookie | ( | SetCookie | $cookie | ) |
Sets a cookie in the cookie jar.
Implements GuzzleHttp\Cookie\CookieJarInterface.
Definition at line 165 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
References GuzzleHttp\Cookie\SetCookie\getDiscard(), GuzzleHttp\Cookie\SetCookie\getDomain(), GuzzleHttp\Cookie\SetCookie\getExpires(), GuzzleHttp\Cookie\SetCookie\getName(), GuzzleHttp\Cookie\SetCookie\getPath(), GuzzleHttp\Cookie\SetCookie\getValue(), and GuzzleHttp\Cookie\SetCookie\validate().
Referenced by GuzzleHttp\Cookie\CookieJar\__construct(), GuzzleHttp\Cookie\CookieJar\extractCookies(), GuzzleHttp\Cookie\SessionCookieJar\load(), and GuzzleHttp\Cookie\FileCookieJar\load().
|
static |
Evaluate if this cookie should be persisted to storage that survives between requests.
| SetCookie | $cookie | Being evaluated. |
| bool | $allowSessionCookies | If we should persist session cookies |
Definition at line 82 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
References GuzzleHttp\Cookie\SetCookie\getDiscard(), and GuzzleHttp\Cookie\SetCookie\getExpires().
Referenced by GuzzleHttp\Cookie\SessionCookieJar\save(), and GuzzleHttp\Cookie\FileCookieJar\save().
| GuzzleHttp\Cookie\CookieJar::toArray | ( | ) |
Converts the cookie jar to an array.
Implements GuzzleHttp\Cookie\CookieJarInterface.
Definition at line 116 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
References GuzzleHttp\Cookie\CookieJar\getIterator(), and GuzzleHttp\Cookie\SetCookie\toArray().
| GuzzleHttp\Cookie\CookieJar::withCookieHeader | ( | RequestInterface | $request | ) |
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.
| RequestInterface | $request | Request object to modify. |
Implements GuzzleHttp\Cookie\CookieJarInterface.
Definition at line 281 of file guzzlehttp/guzzle/src/Cookie/CookieJar.php.
References Psr\Http\Message\RequestInterface\getUri(), and Psr\Http\Message\MessageInterface\withHeader().