Пример #1
0
 /**
  * @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;
 }
Пример #2
0
 /**
  * @param Cookie $cookie
  */
 public function addCookie(Cookie $cookie)
 {
     $name = $cookie->getName();
     $this->_cookies[$name] = $cookie;
 }