Sets headers based on cookie values.
554660
private function setHeadersFromCookies()
    {
        $values = [];

        foreach ($this->cookies as $cookie) {
            $values[] = (string) $cookie;
        }

        $this->setHeader("cookie", $values);
    }
757934
function _setResponseHeaders(headers) {
    this.responseHeaders = {};

    for (var header in headers) {
      if (headers.hasOwnProperty(header)) {
          this.responseHeaders[header] = headers[header];
      }
    }

    if (this.forceMimeType) {
      this.responseHeaders['Content-Type'] = this.forceMimeType;
    }

    if (this.async) {
      this._readyStateChange(FakeXMLHttpRequest.HEADERS_RECEIVED);
    } else {
      this.readyState = FakeXMLHttpRequest.HEADERS_RECEIVED;
    }
  }
437058
public static function setCookieHeaders($cookies)
    {
        if (!empty($cookies) && is_array($cookies) && false === headers_sent() && !self::isTest()) {
            foreach ($cookies as $cookie) {
                setcookie($cookie["name"],
                    $cookie["value"],
                    (array_key_exists('expire', $cookie)) ? $cookie["expire"] : NULL,
                    (array_key_exists('path', $cookie)) ? $cookie["path"] : "/",
                    (array_key_exists('domain', $cookie)) ? $cookie["domain"] : Request::getInstance()->getRootUrl(FALSE),
                    (array_key_exists('secure', $cookie)) ? $cookie["secure"] : FALSE,
                    (array_key_exists('http', $cookie)) ? $cookie["http"] : true
                );
            }
        }
    }
1330929
public function set(string $name, string $value): void
    {
        $key = strtolower($name);
        $this->headers[$key] = [$name, $value];
    }
704656
private function sendHeaders() {
        if (!headers_sent()) {
            http_response_code($this->statusCode);
            foreach ($this->headers as $header) {
                header($header);
            }
            foreach ($this->cookies as $cookie) {
                call_user_func_array("setcookie", $cookie);
            }
        }
    }
994774
function setcookies()
    {
        for ($x = 0; $x < count($this->headers); $x++) {
            if (preg_match('/^set-cookie:[\s]+([^=]+)=([^;]+)/i', $this->headers[$x], $match))
                $this->cookies[$match[1]] = urldecode($match[2]);
        }
        return $this;
    }
675835
def prepare_headers(self, headers):
        """"""

        if headers:
            self.headers = CaseInsensitiveDict((to_native_string(name), value) for name, value in headers.items())
        else:
            self.headers = CaseInsensitiveDict()
993799
public static void setSlugHeader(HttpHeaders headers, String value) {
    if (value == null) {
      headers.remove("Slug");
    } else {
      headers.set("Slug", Lists.newArrayList(Arrays.asList(SLUG_ESCAPER.escape(value))));
    }
  }
666413
public void setAllowHeaders(String... headers) {
        allowHeadersSet.clear();
        for (String header : headers) {
            allowHeadersSet.add(header.toLowerCase());
        }
        allowHeaders = Joiner.on(",").join(headers);
    }
1052656
def add_cookie_to_headers(headers)
      if signed_in_with_remember_token?
        Rack::Utils.set_cookie_header!(
          headers,
          remember_token_cookie,
          cookie_options.merge(
            value: current_user.remember_token,
          ),
        )
      end
    end
40621
def _set_default_headers(self):
        
        self.headers.setdefault('Date', self.get_current_time)
        self.headers.setdefault('Server', self.SERVER_INFO)
        self.headers.setdefault('Content-Length', "%d" % len(self.message))
        if self.app.enabled('x-powered-by'):
            self.headers.setdefault('X-Powered-By', 'Growler')
1252133
function setHeaders(req, headers) {
        var i;
        for (i = 0; i < headers.length; ++i) {
            req.setRequestHeader(headers[i][0], headers[i][1]);
        }
    }
873812
def set(self, name, value, domain, **kwargs):
        

        if domain == 'localhost':
            domain = ''

        self.cookiejar.set_cookie(create_cookie(name, value, domain, **kwargs))
31010
public function setCookie(ResponseCookie $cookie)
    {
        $this->cookies[$cookie->getName()] = $cookie;
        $this->setHeadersFromCookies();
    }
508267
def set_session(self, cookies):
        
        self.__session.cookies = requests.utils.cookiejar_from_dict(cookies)
776496
protected function setHeaders() {
        $headers = $this->request->getHeaders()->toFlatArray();
        $this->resource->setOption(CURLOPT_HTTPHEADER, $headers);
    }
308209
public function setCookies($cookies)
    {
        if (!$cookies instanceof CookieBag) {
            $cookies = new CookieBag(CookieBag::normalize($cookies));
        }

        $this->_cookies = $cookies;
    }