/** * @return CookieJar */ public function getCookies() { $headers = Arrays::value($this->getHeaders(), 'Set-Cookie', []); $cookyJar = new CookieJar(); foreach ($headers as $header) { $cookie = Cookie::fromHeader($header); $cookyJar->addCookie($cookie); } return $cookyJar; }
/** * @param Cookie $cookie */ public function addCookie(Cookie $cookie) { $name = $cookie->getName(); $this->_cookies[$name] = $cookie; }