redis_sessions/session.py
def _get_new_session_key(self):
        """
        This matches expressjs' session key generation provided you are not
        fingerprint'ing the request
        """
        import hashlib
        import hmac
        import base64

        secret = getattr(settings, 'SECRET_KEY', '')

        def hashit(base):
            h = hmac.new(secret, digestmod=hashlib.sha256)
            h.update(base)
            d = h.digest()
            s = base64.b64encode(d).replace('=', '')
            return s

        session_key = None

        while True and not session_key:
            base = get_random_string(32 * 3 / 4)
            session_key = base + '.' + hashit(base)
            if not self.exists(session_key):
                break

        return session_key

        This matches expressjs' session key generation provided you are not
        fingerprint'ing the request
        
This matches expressjs' session key generation provided you are not
fingerprint'ing the request
This matches expressjs ' session key generation provided you are not fingerprint ' ing the request
def _get_new_session_key(self):
        import hashlib
        import hmac
        import base64
        secret = getattr(settings, 'SECRET_KEY', '')
        def hashit(base):
            h = hmac.new(secret, digestmod=hashlib.sha256)
            h.update(base)
            d = h.digest()
            s = base64.b64encode(d).replace('=', '')
            return s
        session_key = None
        while True and not session_key:
            base = get_random_string(32 * 3 / 4)
            session_key = base + '.' + hashit(base)
            if not self.exists(session_key):
                break
        return session_key
def _get_new_session_key ( self ) : import hashlib import hmac import base64 secret = getattr ( settings , 'SECRET_KEY' , '' ) def hashit ( base ) : h = hmac . new ( secret , digestmod = hashlib . sha256 ) h . update ( base ) d = h . digest ( ) s = base64 . b64encode ( d ) . replace ( '=' , '' ) return s session_key = None while True and not session_key : base = get_random_string ( 32 * 3 / 4 ) session_key = base + '.' + hashit ( base ) if not self . exists ( session_key ) : break return session_key
This matches expressjs' session key generation provided you are not
fingerprint'ing the request
This matches expressjs ' session key generation provided you are not fingerprint ' ing the request
"""
        This matches expressjs' session key generation provided you are not
        fingerprint'ing the request
        """
self