Closed adelyafatykhova closed 1 year ago
You may be able to decode the files with pickle.load
from the standard library. flask-session
users werkzeug.contrib.cache
for the implementation of filesystem caching, which is based on pickle
.
Example:
import pickle
with open("<filename>", "rb") as e:
time = pickle.load(e)
data = pickle.load(e)
Pickle should work. You can use also use whatever serializer is currently configured with app.session_interface.serializer
(but default value for this is the pickle module so it's the same thing)
In my code I'm also using want_bytes
imported from itsdangerous
: app.session_interface.serializer.loads(want_bytes(sessiondata))
I'm using filesystem type and want to be able to access the data in the session file in a way that can be parsed or human readable.
These files look something like this now:
Is there any way to be able to retrieve the data from such files?
For context, I had an instance where for my web app writing to the database was briefly not working - but the data I need was also being saved in the session.