def __call__(self, req, res):
        """
        The middleware action. Adds a session member to the req object
        and the session id to the response object.
        """
        qid = self.session_id_name
        try:
            sid = req.cookies[qid].value
        except KeyError:
            sid = req.cookies[qid] = uuid.uuid4()

        res.cookies[qid] = sid

        logger.debug("[DefaultSessionStorage] {}", sid)
        if sid not in self._sessions:
            self._sessions[sid] = {'id': sid}
        req.session = Session(self, self._sessions[sid])
def __call__ ( self , req , res ) : qid = self . session_id_name try : sid = req . cookies [ qid ] . value except KeyError : sid = req . cookies [ qid ] = uuid . uuid4 ( ) res . cookies [ qid ] = sid logger . debug ( "[DefaultSessionStorage] {}" , sid ) if sid not in self . _sessions : self . _sessions [ sid ] = { 'id' : sid } req . session = Session ( self , self . _sessions [ sid ] )
The middleware action. Adds a session member to the req object
        and the session id to the response object.