Class CookieCollection
Container class for cookies used in Http\Client.
Provides cookie jar like features for storing cookies between requests, as well as appending cookies to new requests.
Namespace: Cake\Http\Client
Property Summary
-
$_cookies protected
array
The cookies stored in this jar.
Method Summary
-
get() public
Get stored cookies for a URL.
-
getAll() public
Get all the stored cookies.
-
store() public
Store the cookies from a response.
Method Detail
get() ¶ public
get(string $url): array
Get stored cookies for a URL.
Finds matching stored cookies and returns a simple array of name => value
Parameters
-
string
$url The URL to find cookies for.
Returns
array
store() ¶ public
store(Cake\Http\Client\Response $response, string $url): void
Store the cookies from a response.
Store the cookies that haven't expired. If a cookie has been expired and is currently stored, it will be removed.
Parameters
-
Cake\Http\Client\Response
$response The response to read cookies from
-
string
$url The request URL used for default host/path values.
Returns
void