'Return the given session dictionary serialized and encoded as a string.'

def encode(self, session_dict):

    serialized = self.serializer().dumps(session_dict)
    hash = self._hash(serialized)
    return base64.b64encode(((hash.encode() + ':') + serialized)).decode('ascii')
