Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
Public Member Functions | |
clear (?string $domain=null, ?string $path=null, ?string $name=null) | |
Remove cookies currently held in the cookie jar. | |
clearSessionCookies () | |
Discard all sessions cookies. | |
extractCookies (RequestInterface $request, ResponseInterface $response) | |
Extract cookies from an HTTP response and store them in the CookieJar. | |
setCookie (SetCookie $cookie) | |
Sets a cookie in the cookie jar. | |
toArray () | |
Converts the cookie jar to an array. | |
withCookieHeader (RequestInterface $request) | |
Create a request with added cookie headers. | |
GuzzleHttp\Cookie\CookieJarInterface::clear | ( | ?string | $domain = null, |
?string | $path = null, | ||
?string | $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 |
Implemented in GuzzleHttp\Cookie\CookieJar.
GuzzleHttp\Cookie\CookieJarInterface::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.
Implemented in GuzzleHttp\Cookie\CookieJar.
GuzzleHttp\Cookie\CookieJarInterface::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 |
Implemented in GuzzleHttp\Cookie\CookieJar.
GuzzleHttp\Cookie\CookieJarInterface::setCookie | ( | SetCookie | $cookie | ) |
Sets a cookie in the cookie jar.
SetCookie | $cookie | Cookie to set. |
bool | Returns true on success or false on failure |
Implemented in GuzzleHttp\Cookie\CookieJar.
GuzzleHttp\Cookie\CookieJarInterface::toArray | ( | ) |
Converts the cookie jar to an array.
Implemented in GuzzleHttp\Cookie\CookieJar.
GuzzleHttp\Cookie\CookieJarInterface::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. |
RequestInterface | returns the modified request. |
Implemented in GuzzleHttp\Cookie\CookieJar.