You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be better to use json.dumps() and json.loads() rather than self.encode()/self.decode(). The reason is that the latter pair of inherited methods (encode / decode) are both using Django cryptographic signing/signature verification. This is not really needed when we are saving the session data in Redis because the Redis cache is not going to be accessible to the public. So there is no possibility of bad data entering the cache (leaving aside the Django application deliberately setting bad data).
It would simplify the storage/load if the json serialization functions were used instead. And it would also eliminate the need for using any cryptography.
The text was updated successfully, but these errors were encountered:
When saving the session data:
django-redis-sessions/redis_sessions/session.py
Line 156 in 53021b2
And loading the session data:
django-redis-sessions/redis_sessions/session.py
Line 131 in 53021b2
It would be better to use
json.dumps()
andjson.loads()
rather thanself.encode()
/self.decode()
. The reason is that the latter pair of inherited methods (encode / decode) are both using Django cryptographic signing/signature verification. This is not really needed when we are saving the session data in Redis because the Redis cache is not going to be accessible to the public. So there is no possibility of bad data entering the cache (leaving aside the Django application deliberately setting bad data).It would simplify the storage/load if the
json
serialization functions were used instead. And it would also eliminate the need for using any cryptography.The text was updated successfully, but these errors were encountered: