Created
June 10, 2019 18:30
-
-
Save tomdottom/b3dfe9c5993cc692ff9194fc4b5e6cce to your computer and use it in GitHub Desktop.
How to decode flask session cookies as retrieved from the browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from types import SimpleNamespace | |
from io import StringIO | |
from flask.sessions import SecureCookieSessionInterface | |
session_cookie = "... get me from your browser ..." | |
secret_key = "... get me from your app settings ..." | |
app = SimpleNamespace(secret_key=secret) | |
session = SecureCookieSessionInterface() | |
s = session.get_signing_serializer(app) | |
s.load(StringIO(session_cookie)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment