Example #1
0
 /**
  * @param array $cookies
  */
 protected function buildCookies(array $cookies)
 {
     $header = '';
     foreach ($cookies as $key => $value) {
         $header .= $this->formatCookie($key, $value) . ' ';
     }
     $this->holder->getHeaders()->set('cookie', $header);
 }
Example #2
0
 /**
  * Parse headers for cookies.
  */
 protected function searchCookiesInHeaders()
 {
     $headers = $this->holder->getHeaders()->get('set-cookie');
     foreach ($headers as $header) {
         $cookie = $this->createCookieFromHeader($header);
         if ($cookie !== null) {
             $this->storeCookie($cookie);
         }
     }
 }
Example #3
0
 /**
  * @return bool
  */
 public function hasBasicAuth()
 {
     return $this->parser->hasBasicAuth($this->holder->getHeaders());
 }