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.
21 $response = (new http\Client)
22 ->enqueue(new http\Client\Request("GET", "http://php.net/"))
26 foreach ($response->getCookies() as $cookie) {
27 /* @var $cookie http\Cookie */
28 foreach ($cookie->getCookies() as $name => $value) {
29 printf("Got a cookie named '%s' with value '%s'\n\tdomain=%s\n\t path=%s\n",
30 $name, $value, $cookie->getDomain(), $cookie->getPath());
37 Got a cookie named 'COUNTRY' with value 'USA,72.52.91.14'