a cookie in index should be returned
349213
private <T extends Comparable<T>>
        void getInternal2(List<HttpCookie> cookies, Map<T, List<HttpCookie>> cookieIndex,
                          T comparator)
    {
        // Removed cookieJar
        for (T index : cookieIndex.keySet()) {
            if ((index == comparator) || (index != null && comparator.compareTo(index) == 0)) {
                List<HttpCookie> indexedCookies = cookieIndex.get(index);
                // check the list of cookies associated with this domain
                if (indexedCookies != null) {
                    Iterator<HttpCookie> it = indexedCookies.iterator();
                    while (it.hasNext()) {
                        HttpCookie ck = it.next();
                        // the cookie still in main cookie store
                        if (!ck.hasExpired()) {
                            // don't add twice
                            if (!cookies.contains(ck))
                                cookies.add(ck);
                        } else {
                            it.remove();
                        }
                    }
                } // end of indexedCookies != null
            } // end of comparator.compareTo(index) == 0
        } // end of cookieIndex iteration
    }
1287851
function get(key, decoder = decodeURIComponent) {
  if ((typeof key !== 'string') || !key) {
    return null;
  }

  const reKey = new RegExp(`(?:^|; )${escapeRe(key)}(?:=([^;]*))?(?:;|$)`);
  const match = reKey.exec(document.cookie);

  if (match === null) {
    return null;
  }

  return typeof decoder === 'function' ? decoder(match[1]) : match[1];
}
173875
static void greedy(Cookie cookie, LongestMatchCache lmc, byte[] input, int from, int to, LzStore store) {
        Hash h = cookie.h;
        h.init(input, Math.max(from - 0x8000, 0), from, to);
        int prevLength = 0;
        int prevMatch = 0;
        char[] dummySubLen = cookie.c259a;
        boolean matchAvailable = false;

        for (int i = from; i < to; i++) {
            h.updateHash(input, i, to);
            findLongestMatch(cookie, lmc, from, h, input, i, to, 258, dummySubLen);
            int len = cookie.lenVal;
            int dist = cookie.distVal;
            int lengthScore = dist > 1024 ? len - 1 : len;
            int prevLengthScore = prevMatch > 1024 ? prevLength - 1 : prevLength;

            if (matchAvailable) {
                matchAvailable = false;
                if (lengthScore > prevLengthScore + 1) {
                    store.append((char) (input[i - 1] & 0xFF), (char) 0);
                    if (lengthScore >= 3 && len < 258) {
                        matchAvailable = true;
                        prevLength = len;
                        prevMatch = dist;
                        continue;
                    }
                } else {
                    store.append((char) prevLength, (char) prevMatch);
                    for (int j = 2; j < prevLength; j++) {
                        i++;
                        h.updateHash(input, i, to);
                    }
                    continue;
                }
            } else if (lengthScore >= 3 && len < 258) {
                matchAvailable = true;
                prevLength = len;
                prevMatch = dist;
                continue;
            }

            if (lengthScore >= 3) {
                store.append((char) len, (char) dist);
            } else {
                len = 1;
                store.append((char) (input[i] & 0xFF), (char) 0);
            }
            for (int j = 1; j < len; j++) {
                i++;
                h.updateHash(input, i, to);
            }
        }
    }
103107
function _getCookieToken (cookies, req, cookieName, cookieDomain, publicUrl) {
  let token = cookies.get(cookieName)
  if (!token) return null
  const reqOrigin = req.headers['origin']
  const originDomain = reqOrigin && new URL(reqOrigin).host

  // check that the origin of the request is part of the accepted domain
  if (reqOrigin && cookieDomain && originDomain !== cookieDomain && !originDomain.endsWith('.' + cookieDomain)) {
    debug(`A cookie was sent from origin ${reqOrigin} while cookie domain is ${cookieDomain}, ignore it`)
    return null
  }
  // or simply that it is strictly equal to current target if domain is unspecified
  // in this case we are also protected by sameSite
  if (reqOrigin && !cookieDomain && reqOrigin !== new URL(publicUrl).origin) {
    debug(`A cookie was sent from origin ${reqOrigin} while public url is ${publicUrl}, ignore it`)
    return null
  }

  // Putting the signature in a second token is recommended but optional
  // and we accept full JWT in id_token cooke
  const signature = cookies.get(cookieName + '_sign')
  if (signature && (token.match(/\./g) || []).length === 1) {
    token += '.' + signature
  }
  return token
}
446610
function _getByIndex(indexName, indexData, callback) {
    // generate the index
    var index = indexName + '-' +
      crypto.createHash('sha256').update(indexData).digest('hex');

    // fetch the value of the index
    client.get(index, function(err, reply) {
      if(err) {
        return callback(err);
      }
      if(!reply) {
        // index does not exist
        return callback(null, null);
      }

      // fetch the actual data
      client.get(reply, _deserializeJson(callback));
    });
  }
53698
def cookies(self):
        """"""
        return parse_cookie(
            self.environ,
            self.charset,
            self.encoding_errors,
            cls=self.dict_storage_class,
        )
397622
def set_cookie(key, value, options={})
      cookie = ["#{key}=#{value};"]


      if options.has_key? :expires and options[:expires].kind_of? Time
        options[:expires] = options[:expires].utc.strftime('%a, %d-%b-%Y %H:%M:%S GMT')
      end

      # Sort the cookies alphabetically.
      options.sort { |a,b| a.to_s <=> b.to_s }.each do |k,v|
        cookie << "#{k}=#{v.to_s};"
      end

      cookie_val = cookie.join(' ')

      if self.headers['Set-Cookie'].nil?
        self.headers['Set-Cookie'] = [cookie_val]
      else
        self.headers['Set-Cookie'] << cookie_val
      end
    end
1229284
function(key, value){
		var ls = this._local.localStorage; // null, sessionStorage, or localStorage

		if( value === undefined ) {
			return ls ? ls.getItem(key) : $.cookie(key);
		} else if ( value === null ) {
			if( ls ) {
				ls.removeItem(key);
			} else {
				$.removeCookie(key);
			}
		} else {
			if( ls ) {
				ls.setItem(key, value);
			} else {
				$.cookie(key, value, this.options.persist.cookie);
			}
		}
	}
621828
function(data) {
  var self = this;
  this._cookie = new tc.Cookie();

  modifiable.map(function(attribute) {
    Object.defineProperty(self, attribute, {
    enumerable: true
    , get: function() {
        return self._cookie[attribute];
      }
    , set: function(val) {
        self._cookie[attribute] = val;
      }
    });
  });

  readOnly.map(function(attribute) {
    Object.defineProperty(self, attribute, {
      get: function(){
        return this._cookie[attribute];
      }
    , set: noop
    , enumerable: true
    });
  });

  this.set(data);
}
178101
def get_cookie(self, key, secret=None):
        
        value = self.COOKIES.get(key)
        if secret and value:
            dec = cookie_decode(value, secret) # (key, value) tuple or None
            return dec[1] if dec and dec[0] == key else None
        return value or None
951088
function (opts, ctx) {
    const cookie = opts.cookie;
    const obj = cookie instanceof Function ? cookie(ctx) : cookie;
    const options = Object.assign({
        maxAge: 0,
        path: '/',
        httpOnly: true
    }, obj || {}, {
            overwrite: true,
            signed: false
        });
    if (!(opts.maxAge >= 0)) opts.maxAge = 0;
    return options;
}
1038985
function(key, defaultValue){
            if($ExpressSESSION.session.store[key]){
                return $ExpressSESSION.session.store[key];
            }
            if(defaultValue) return defaultValue;
            else throw new Error('index '+key+' not exists in session');
        }
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;
        }
      }
    });
  }
}
365741
def getCookies(self):
        '''
        
        '''
        items = self.data
        for item in items:
            if 'cookie' in item or 'Cookie' in item:
                cookies = SimpleCookie(item[7:])
                return {i.key: i.value for i in cookies.values()}
        return {}
455662
function(name) {
		var cookie = document.cookie, e, p = name + "=", b;

		if ( !cookie )
			return;

		b = cookie.indexOf("; " + p);

		if ( b == -1 ) {
			b = cookie.indexOf(p);

			if ( b != 0 )
				return null;

		} else {
			b += 2;
		}

		e = cookie.indexOf(";", b);

		if ( e == -1 )
			e = cookie.length;

		return decodeURIComponent( cookie.substring(b + p.length, e) );
	}
118905
public function cookie(string $index = '', $xss_clean = false)
    {
        return $this->fetchFromArray($_COOKIE, $index, $xss_clean);
    }
635434
function getItem(key) {
  var parsed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var fallbackValue = arguments[2];

  var result = void 0;

  var cookieItem = cookie$1.getItem(key);
  var sessionItem = session.getItem(key);

  if (!hasLocalStorage()) {
    result = cookieItem || sessionItem;
  } else {
    result = localstorage.getItem(key) || cookieItem || sessionItem;
  }

  var item = parsed ? parse(result) : result;

  if ((typeof item === 'undefined' || item === null) && typeof fallbackValue !== 'undefined') {
    return fallbackValue;
  }

  return item;
}