Retrieve one cookie visible to the current page.
176206
public function get($name)
    {
        $command = $this->driver->factoryCommand('cookie', WebDriver_Command::METHOD_GET);
        $value = $this->driver->curl($command)['value'];
        $search = array_filter(
            $value,
            function ($item) use ($name) {
                return ($item['name'] == $name);
            }
        );
        $search = array_values($search);
        $value = empty($search)?null:$search[0];
        if ($value) {
            $value = new WebDriver_Object_Cookie_CookieInfo($value);
        }
        return $value;
    }
547202
def cookies(self) -> Dict[str, str]:
        """"""
        cookies = SimpleCookie()
        cookies.load(self.headers.get('Cookie', ''))
        return {key: cookie.value for key, cookie in cookies.items()}
1109047
def _load_cookie(self):
        """"""

        cookie = SimpleCookie(self._environ.get('HTTP_COOKIE'))
        vishnu_keys = [key for key in cookie.keys() if key == self._config.cookie_name]

        # no session was started yet
        if not vishnu_keys:
            return

        morsel = cookie[vishnu_keys[0]]
        morsel_value = morsel.value

        if self._config.encrypt_key:
            cipher = AESCipher(self._config.encrypt_key)
            morsel_value = cipher.decrypt(morsel_value)

        received_sid = Session.decode_sid(self._config.secret, morsel_value)
        if received_sid:
            self._sid = received_sid
        else:
            logging.warn("found cookie with invalid signature")
413780
function getCookie(cname) {
            var name = cname + "=";
            var ca = doc.cookie.split(';'),
                i = 0,
                l = ca.length;
            for (; i < l; i++) {
                var c = ca[i];
                while (c.charAt(0) == ' ') {
                    c = c.substring(1);
                }if (c.indexOf(name) != -1) return unescape(c.substring(name.length, c.length));
            }
            return "";
        }
1139068
def cookies(self):
        
        return (self.get_query()
                .select(PageView.ip, PageView.headers['Cookie'])
                .where(PageView.headers['Cookie'].is_null(False))
                .tuples())
712446
def filter_cookies(self, request_url: URL=URL()) -> 'BaseCookie[str]':
        """"""
        self._do_expiration()
        request_url = URL(request_url)
        filtered = SimpleCookie()
        hostname = request_url.raw_host or ""
        is_not_secure = request_url.scheme not in ("https", "wss")

        for cookie in self:
            name = cookie.key
            domain = cookie["domain"]

            # Send shared cookies
            if not domain:
                filtered[name] = cookie.value
                continue

            if not self._unsafe and is_ip_address(hostname):
                continue

            if (domain, name) in self._host_only_cookies:
                if domain != hostname:
                    continue
            elif not self._is_domain_match(domain, hostname):
                continue

            if not self._is_path_match(request_url.path, cookie["path"]):
                continue

            if is_not_secure and cookie["secure"]:
                continue

            # It's critical we use the Morsel so the coded_value
            # (based on cookie version) is preserved
            mrsl_val = cast('Morsel[str]', cookie.get(cookie.key, Morsel()))
            mrsl_val.set(cookie.key, cookie.value, cookie.coded_value)
            filtered[name] = mrsl_val

        return filtered
581957
function cookieToHeader(cookies) {
    const SEPARATOR = '; ';
    return cookies.reduce(function (previous, current) {
        return previous + current.name + '=' + current.value + SEPARATOR;
    }, '');
}
144183
def cookies(self):
        ''''''
        return {
            key: self.raw_cookies[key].value
            for key in self.raw_cookies.keys()
        }
540474
def pin_cookie_name(self):
        """"""
        if not hasattr(self, "_pin_cookie"):
            self._pin, self._pin_cookie = get_pin_and_cookie_name(self.app)
        return self._pin_cookie
667718
def get_cookie_jar(self):
    """"""
    cookie_file = self._get_cookie_file()
    cookie_jar = LWPCookieJar(cookie_file)
    if os.path.exists(cookie_file):
      cookie_jar.load()
    else:
      safe_mkdir_for(cookie_file)
      # Save an empty cookie jar so we can change the file perms on it before writing data to it.
      with self._lock:
        cookie_jar.save()
      os.chmod(cookie_file, 0o600)
    return cookie_jar
729455
protected function getCookies() {
    $current_request = $this->requestStack->getCurrentRequest();
    if (isset($current_request->cookies)) {
      return $current_request->cookies->all();
    }
    return $_COOKIE;
  }
462516
def cookie(self, value):
        
        if value and not value.is_empty():
            self._cookie = value
        else:
            self._cookie = Cookie()
643549
def clean_cookie(self):
        """"""
        if not self.is_cookie_necessary:
            return self
        headers = self.request.get('headers', {})
        cookies = SimpleCookie(headers['Cookie'])
        for k, v in cookies.items():
            new_cookie = '; '.join(
                [i.OutputString() for i in cookies.values() if i != v])
            new_request = deepcopy(self.request)
            new_request['headers']['Cookie'] = new_cookie
            self._add_task('Cookie', k, new_request)
        return self
1124342
async def get_ticket(self, request):
        
        session = await get_session(request)
        return session.get(self.cookie_name)
279437
def extract_cookies(self, response, request):
        """"""
        _debug("extract_cookies: %s", response.info())
        self._cookies_lock.acquire()
        try:
            self._policy._now = self._now = int(time.time())

            for cookie in self.make_cookies(response, request):
                if self._policy.set_ok(cookie, request):
                    _debug(" setting cookie: %s", cookie)
                    self.set_cookie(cookie)
        finally:
            self._cookies_lock.release()
1062056
def get_blink_cookie(self, name):
        """"""
        value = self.get_cookie(name)

        if value != None:
            self.clear_cookie(name)
            return escape.url_unescape(value)
1055884
public Cookie cookie(String expectedCookieName) {
        try {
            return driver.manage().getCookieNamed(expectedCookieName);
        } catch (Exception e) {
            log.warn(e);
            return null;
        }
    }