Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block aescalana

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aescalana /
Last active Sep 21, 2019
Decode and Encode Flask's session cookie. Great for testing purposes; only the secret key is needed
#!/usr/bin/env python
from flask.sessions import SecureCookieSessionInterface
from itsdangerous import URLSafeTimedSerializer
class SimpleSecureCookieSessionInterface(SecureCookieSessionInterface):
# Override method
# Take secret_key instead of an instance of a Flask app
def get_signing_serializer(self, secret_key):
if not secret_key:
return None
You can’t perform that action at this time.