Load session from cookies.
557328
def load(self, cookies, **kwargs):
        """"""
        value = cookies.get(self.key, None)
        if value is None:
            return False

        value = self.decrypt(value)
        if not value:
            return False

        data = json.loads(value)
        if not isinstance(data, dict):
            return False

        self.store = data
        self.update(self.store)
158917
def load_cookies_file(cookies_file):
    

    logging.debug('Loading cookie file %s into memory.', cookies_file)

    cookies = StringIO()
    cookies.write('# Netscape HTTP Cookie File')
    cookies.write(open(cookies_file, 'rU').read())
    cookies.flush()
    cookies.seek(0)
    return cookies
137598
def get_cookies_from_cache(username):
    

    logging.debug('Trying to get cookies from the cache.')

    path = get_cookies_cache_path(username)
    cj = requests.cookies.RequestsCookieJar()
    try:
        cached_cj = get_cookie_jar(path)
        for cookie in cached_cj:
            cj.set_cookie(cookie)
        logging.debug(
            'Loaded cookies from %s', get_cookies_cache_path(username))
    except IOError:
        logging.debug('Could not load cookies from the cache.')

    return cj
374472
public function loadFromSession()
    {
        $this->session = Instance::ensure($this->session, Session::className());
        if (isset($this->session[$this->cartId]))
            $this->setSerialized($this->session[$this->cartId]);
    }
53698
def cookies(self):
        """"""
        return parse_cookie(
            self.environ,
            self.charset,
            self.encoding_errors,
            cls=self.dict_storage_class,
        )
1221684
def _really_load(self, f, filename, ignore_discard, ignore_expires):
        ''''''
        data = json.load(f) or []
        now = time.time()
        for cookie in map(go_to_py_cookie, data):
            if not ignore_expires and cookie.is_expired(now):
                continue
            self.set_cookie(cookie)
117653
def parse_cookies(self, req, name, field):
        """"""
        return core.get_value(req.COOKIES, name, field)
94923
def load(self, _override=True, _allow_undeclared=False, **kwargs):
    """"""
    self.load_from_dict(
        kwargs, _override=_override, _allow_undeclared=_allow_undeclared)
1207997
def login_from_cookie
      account = cookies[:auth_token] && Account.find_by_remember_token(cookies[:auth_token])
      if account && account.remember_token?
        account.remember_me
        cookies[:auth_token] = { :value => account.remember_token, :expires => account.remember_token_expires_at }
        self.auth_type_used = :cookie if not account.nil?
        self.current_account = account
        account
      end
    end
575124
function (req) {
	var cookie = SR.REST.getCookie(req.headers.cookie);
	var session = SR.EventManager.getSession(cookie);
	return session;
}
799530
def from_response(cls, header_data, ignore_bad_cookies=False,
                      ignore_bad_attributes=True):
        ""
        cookies = cls()
        cookies.parse_response(
            header_data,
            ignore_bad_cookies=ignore_bad_cookies,
            ignore_bad_attributes=ignore_bad_attributes)
        return cookies
541755
async def login(self, request, id_):
        """"""
        session = await self.load(request)
        session['id'] = id_
1273219
def load_session
      unless logged_in?
        session[Shibbolite.pid] = request.env[Shibbolite.pid.to_s]
        current_user.update(get_attributes) if registered_user?
      end
    end
1033830
def dispatch(self):
    """"""
    try:
      webapp2.RequestHandler.dispatch(self)
    finally:
      self.session_store.save_sessions(self.response)
138621
def login(self):
        
        resp = super(CookieSession, self).request(
            'POST',
            self._session_url,
            data={'name': self._username, 'password': self._password},
        )
        resp.raise_for_status()
252414
def load(self):
        

        response = self.table.get_item(
            Key={'session_key': self.session_key},
            ConsistentRead=ALWAYS_CONSISTENT)
        if 'Item' in response:
            session_data = response['Item']['data']
            return self.decode(session_data)
        else:
            self.create()
            return {}
652973
def _prepare_cookies(self, command, url):
        

        req = requests.models.Request()
        req.method = 'GET'
        req.url = url

        cookie_values = requests.cookies.get_cookie_header(
            self.session.cookies, req)

        if cookie_values:
            self._add_cookies(command, cookie_values)