Update cookie cache
@params url {object} The parsed URL object
@params cookies {array|string} The array of cookies or single cookie
165061
function set_cookies(url, cookies) {
	if(is.string(cookies)) {
		cookies = [cookies];
	}
	debug.assert(url).is('object');
	debug.assert(url.host).is('string');
	debug.assert(cookies).is('array');

	//debug.log('Saving cookies for host = ', url.host);

	if(!is.array(_cookies[url.host])) {
		_cookies[url.host] = cookies;
		//debug.log('Saved new cookies as: ', _cookies[url.host]);
		return;
	}

	var tmp = {};

	function save_cookie(cookie) {
		var i = cookie.indexOf('=');
		var name = cookie.substr(0, ((i >= 1) ? i : cookie.length));
		tmp[name] = cookie;
	}

	ARRAY(_cookies[url.host]).forEach(save_cookie);
	ARRAY(cookies).forEach(save_cookie);

	_cookies[url.host] = ARRAY(Object.keys(tmp)).map(function(key) { return tmp[key]; }).valueOf();

	//debug.log('Saved new cookies as: ', _cookies[url.host]);
}
308209
public function setCookies($cookies)
    {
        if (!$cookies instanceof CookieBag) {
            $cookies = new CookieBag(CookieBag::normalize($cookies));
        }

        $this->_cookies = $cookies;
    }
923074
function _updateAllElements({ updateCache } = {}) {
        elements.forEach(element => {
            _updateElementPosition(element);
            if (updateCache) {
                element.setCachedAttributes(view, scroll);
            }
        });
        // reset ticking so more animations can be called
        ticking = false;
    }
1164514
function __Cookies(_cookies) {
  this.cookies = {};
  if (!_cookies || typeof _cookies !== 'string') {
    _cookies = '';
  }

  if (_cookies && _cookies.length) {
    var self = this;
    var i;
    var key;
    var val;

    _cookies.split(/;\ */).forEach(function (pair) {
      i = pair.indexOf('=');
      if (i < 0) {
        return;
      }

      key = unescape(pair.substr(0, i).trim());
      val = pair.substr(++i, pair.length).trim();

      if (val[0] === '"') {
        val = val.slice(1, -1);
      }

      if (self.cookies[key] === void 0) {
        try {
          self.cookies[key] = unescape(val);
        } catch (e) {
          self.cookies[key] = val;
        }
      }
    });
  }
}
1199496
@Override
    public void addCookie(Cookie cookie) {
        super.addCookie(cookie);
        if(this.cookies == null) {
            this.cookies = new HashSet<Cookie>();
        }

        this.cookies.add(cookie);
    }
984674
private void parseCookie(io.netty.handler.codec.http.cookie.Cookie nettyCookie) {
        var cookie = new Cookie();
        cookie.name(nettyCookie.name());
        cookie.value(nettyCookie.value());
        cookie.httpOnly(nettyCookie.isHttpOnly());
        cookie.path(nettyCookie.path());
        cookie.domain(nettyCookie.domain());
        cookie.maxAge(nettyCookie.maxAge());
        this.cookies.put(cookie.name(), cookie);
    }
760304
def update_session(self, alias, headers=None, cookies=None):
        
        session = self._cache.switch(alias)
        session.headers = merge_setting(headers, session.headers)
        session.cookies = merge_cookies(session.cookies, cookies)
824593
public function addCookie(Cookie $cookie)
    {
        if (!$this->hasCookie($cookie)) {
            $cookies = $this->getMatchingCookies($cookie);

            foreach ($cookies as $matchingCookie) {
                if ($cookie->getValue() !== $matchingCookie->getValue() || $cookie->getMaxAge() > $matchingCookie->getMaxAge()) {
                    $this->removeCookie($matchingCookie);

                    continue;
                }
            }

            if ($cookie->hasValue()) {
                $this->cookies->attach($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;
    }
609007
public function addCookie($cookie = Array())
    {
        foreach ($cookie as $key => $val) {
            if (isset($this->encryption_key)) {
                $val = $this->encryptor->encrypt($val);
            }

            $this->cookies[$key] = $val;
        }
    }
314979
protected function _maybe_refresh_cache( $url ) {
		$cache = Cache::get( $url );

		if ( ! $cache || is_admin() ) {
			Cache::refresh( $url );
		}
	}
469767
function set(name, value) {

        // if no value then remove
        if (!value) {
            remove(name);
            return;
        }

        if (localStorage) {
            try {
                localStorage.setItem(name, value);
            }
            catch (ex) {}
        }

        _.isFunction($cookies.put) ?
            $cookies.put(name, value, { domain: cookieDomain }) :
            $cookies[name] = value;

    }
409968
function setHeaders(res, body) {
    res.setHeader("Cache-Control", "public, max-age=0");
    res.setHeader("Content-Type", "text/javascript");
    res.setHeader("ETag", etag(body));
}
762508
def __addcookies(self):
        '''
        '''
        for cname, morsel in self.cookies.items():
            attrs = []
            value = morsel.get('version', '')
            if value != '' and value != '0':
                attrs.append('$Version=%s' % value)
            attrs.append('%s=%s' % (cname, morsel.coded_value))
            value = morsel.get('path')
            if value:
                attrs.append('$Path=%s' % value)
            value = morsel.get('domain')
            if value:
                attrs.append('$Domain=%s' % value)
            self.h.putheader('Cookie', "; ".join(attrs))
651543
function(_url,_mode,_cookie){
            _j0._$request(_url,{
                type:'json',
                method:'POST',
                cookie:_cookie,
                mode:parseInt(_mode)||0,
                onload:function(_data){
                    if (!this.__timer) return;
                    this._$dispatchEvent('onuploading',_data);
                    this.__timer = window.setTimeout(
                        _doProgress._$bind(
                            this,_url,_mode,_cookie
                        ),1000
                    );
                }._$bind(this),
                onerror:function(_error){
                    if (!this.__timer) return;
                    this.__timer = window.setTimeout(
                        _doProgress._$bind(
                            this,_url,_mode,_cookie
                        ),1000
                    );
                }._$bind(this)
            });
        }
1184322
def set_cookie(src, dst)
      if str = src['set-cookie']
        cookies = []
        str.split(/,\s*/).each{|token|
          if /^[^=]+;/o =~ token
            cookies[-1] << ", " << token
          elsif /=/o =~ token
            cookies << token
          else
            cookies[-1] << ", " << token
          end
        }
        dst.cookies.replace(cookies)
      end
    end
1041769
function parseCookie(str) {
  var obj = {},
    pairs = str.split(/[;,] */);

  for (var pair,eqlIndex,key,val,i=0; i < pairs.length; i++) {
    pair = pairs[i];
    eqlIndex = pair.indexOf('=');
    key = pair.substr(0, eqlIndex).trim().toLowerCase();
    val = pair.substr(++eqlIndex, pair.length).trim();
    if ('"' === val[0]) val = val.slice(1, -1);
    if (obj[key] === undefined) {
      val = val.replace(/\+/g, ' ');
      try {
        obj[key] = decodeURIComponent(val);
      } catch (err) {
        if (err instanceof URIError) {
          obj[key] = val;
        } else {
          throw err;
        }
      }
    }
  }
  return obj;
}