# Generate 32 random bytes
int8s = random.sample(range(0, 256), 32)
# Base64 encode their string representation
- self['session_id'] = base64.b64encode(bytes(int8s))
+ self['session_id'] = base64.b64encode(bytes(int8s)).decode()
# Force insert
insert = True