The session ID in header type format. Can be inserted into a
        connection if necessary using::
        
            {'Cookie': session.session_id}
        
        :rtype: str
513837
def session_id(self):
        
        return None if not self.session or 'JSESSIONID' not in \
            self.session.cookies else 'JSESSIONID={}'.format(
                self.session.cookies['JSESSIONID'])
822710
def session(self):
        
        if self._session is None:
            self._session = requests.Session()
            self._session.headers.update(self._headers)
        return self._session
1352049
def get_vary_headers(self, request, response):
        

        headers = []
        accessed = False
        try:
            accessed = request.session.accessed
        except AttributeError:
            pass

        if accessed:
            headers.append("Cookie")
        return headers
367798
def parse_headers(self, use_cookies, raw):
        
        if not raw:
            packet = helper.to_str(helper.read_file(self.fpth))
        else:
            packet = raw
        dat = {}

        pks = [x for x in packet.split('\n') if x.replace(' ', '')]
        url = pks[0].split(' ')[1]

        for i, cnt in enumerate(pks[1:]):
            arr = cnt.split(':')
            if len(arr) < 2:
                continue
            arr = [x.replace(' ', '') for x in arr]
            _k, v = arr[0], ':'.join(arr[1:])
            dat[_k] = v

        if use_cookies:
            try:
                self.fmt_cookies(dat.pop('Cookie'))
            except:
                pass
        self.headers = dat
        self.url = 'https://{}{}'.format(self.headers.get('Host'), url)
        return url, dat
756152
def get_nameid_format(request, key=None):
        
        name_id_format = None
        name_id_data = OneLogin_Saml2_Logout_Request.get_nameid_data(request, key)
        if name_id_data and 'Format' in name_id_data.keys():
            name_id_format = name_id_data['Format']
        return name_id_format
725456
def id(self):
        
        h = hashlib.new('sha512')
        for value in (self.machine.name, self.machine.os, self.user, self.application.name,
                      self.application.path, self.event.report_type, self.event.type,
                      self.event.time.isoformat()):
            h.update(str(value).encode('utf-8'))
        for parameter in sorted(self.parameters, key=lambda k: getattr(k, 'id')):
            h.update(parameter.value.encode('utf-8'))
        return h.hexdigest()
711187
def session(self):
        
        if self._session is None:
            self._session = requests.Session()
            log.debug("Connecting to {0}".format(self.auth_url))
            # Disable SSL warning when ssl_verify is False
            if not self.ssl_verify:
                requests.packages.urllib3.disable_warnings(
                    InsecureRequestWarning)
            if self.auth_type == 'basic':
                basic_auth = (self.auth_username, self.auth_password)
                response = self._session.get(
                    self.auth_url, auth=basic_auth, verify=self.ssl_verify)
            else:
                gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=DISABLED)
                response = self._session.get(
                    self.auth_url, auth=gssapi_auth, verify=self.ssl_verify)
            try:
                response.raise_for_status()
            except requests.exceptions.HTTPError as error:
                log.error(error)
                raise ReportError('Jira authentication failed. Try kinit.')
        return self._session
393650
def session(self) -> str:
        
        session_jwt = None
        self.user = self.user_model.where_username(self.username)
        if self.user is None:
            return None
        self.user.updated()  # update timestamp on user access
        if self.verify_password(self.user.password):
            session_id = Session.create_session_id()
            data = {
                'session_id': session_id,
                'user_id': self.user.id,
                'user_email': self.user.email,
            }
            token_valid_for = \
                current_app.config['AUTH']['JWT']['TOKENS']['VALID_FOR'] if \
                'VALID_FOR' in \
                current_app.config['AUTH']['JWT']['TOKENS'] else 180
            if current_app.config['AUTH']['JWT']['REFRESH_TOKENS']['ENABLED']:
                refresh_token_valid_for = \
                    current_app \
                    .config['AUTH']['JWT']['REFRESH_TOKENS']['VALID_FOR'] if \
                    'VALID_FOR' in \
                    current_app.config['AUTH']['JWT']['REFRESH_TOKENS'] else \
                    86400
                session_jwt = JWT().create_token_with_refresh_token(
                    data,
                    token_valid_for,
                    refresh_token_valid_for)
            else:
                session_jwt = JWT().create_token(data, token_valid_for)
            Session.create_session(session_id, self.user.id)
            return session_jwt
        return None
592127
def handle_session_cookie(self):
        """"""
        # If JSESSIONID support is disabled in the settings, ignore cookie logic
        if not self.server.settings['jsessionid']:
            return

        cookie = self.cookies.get('JSESSIONID')

        if not cookie:
            cv = 'dummy'
        else:
            cv = cookie.value

        self.set_cookie('JSESSIONID', cv)
1023366
def get_authorization_header():
    
    header = request.environ.get('HTTP_AUTHORIZATION')

    if not header:
        return None

    header = wsgi_to_bytes(header)

    try:
        auth_type, auth_info = header.split(None, 1)
        auth_type = auth_type.lower()
    except ValueError:
        return None

    return auth_type, auth_info
499127
def _session_start(self):
        
        return self._session_class(self._session_id,
                                   self._session_duration,
                                   self._session_settings)
484292
def session(self):
        
        if self._session is None:
            self._session = requests.session()
            self._session.headers.update(
                {
                    "Authorization": "Bearer {}".format(self.token),
                    "User-Agent": "ads-api-client/{}".format(__version__),
                    "Content-Type": "application/json",
                }
            )
        return self._session
651854
def _get_authenticated_session(self):
        
        session = requests.Session()
        session.auth = self.auth
        return session
814843
def _create_session(self):
        
        self.driver = requests.Session(**self.driver_args)
        # Set default headers
        self.update_headers(self.current_headers)
        self.update_cookies(self.current_cookies)
        self.set_proxy(self.current_proxy)
1355871
def session_info(self, session):
        
        _, sp_hkey = self._keygen(session)
        picked_event = self.r.hgetall(sp_hkey)
        event = {s(k): pickle.loads(v) for k, v in picked_event.items()}
        return event
1255351
def doc_id(self):
        
        if self.id:
            return '%s_%s' % (self.doc_type, self.id.lower())
        return self._hashed_key
1036843
def parse_cookies_str(cookies):
    
    cookie_dict = {}
    for record in cookies.split(";"):
        key, value = record.strip().split("=", 1)
        cookie_dict[key] = value
    return cookie_dict