flask-session
flask-session copied to clipboard
redis option for json serializer
To use json instead of pickle for serialize, you' d better set a redis instance like this:
from flask_session import Session, RedisSessionInterface
RedisSessionInterface.serializer = json
rds = redis.Redis(decode_responses=True) # make sure utf8
app.config['SESSION_REDIS'] = rds
This issue was moved to mcrowson/flask-session#11
Msgspec will be added in 0.7.0 with JSON and Msgpack support. Also note, subclassing interfaces will need to import redis.RedisSessionInterface.
This is a great tip to use for best security until Pickle is fully removed in 1.0.0