1 # mixed http\Client\Response::getCookies([int $flags = 0[, array $allowed_extras = NULL]])
3 Extract response cookies.
4 Parses any "Set-Cookie" response headers into an http\Cookie list. See http\Cookie::__construct().
8 * Optional int $flags = 0
10 * Optional array $allowed_extras = NULL
11 List of keys treated as extras.
15 * array, list of http\Cookie instances.
20 $response = (new http\Client)
21 ->enqueue(new http\Client\Request("GET", "http://php.net/"))
25 foreach ($response->getCookies() as $cookie) {
26 /* @var $cookie http\Cookie */
27 foreach ($cookie->getCookies() as $name => $value) {
28 printf("Got a cookie named '%s' with value '%s'\n\tdomain=%s\n\t path=%s\n",
29 $name, $value, $cookie->getDomain(), $cookie->getPath());
36 Got a cookie named 'COUNTRY' with value 'USA,72.52.91.14'