Tools / Flask Session Decoder
Flask Session Cookie Decoder
Paste a Flask session cookie value and the tool splits it into payload / timestamp / signature, decompresses the zlib payload if Flask compressed it, parses the JSON, and - if you supply the secret key - verifies the HMAC.
Anatomy of a Flask session cookie
Flask uses itsdangerous to serialize session data into a single cookie value. The format is three base64url-encoded parts joined by .: payload.timestamp.signature. The payload is JSON; if it would be larger than the encoded original it gets prefixed with a literal . and zlib-compressed before encoding. The timestamp is Unix seconds (itsdangerous 2.x, which is what current Flask ships; the 1.x line offset from a 2011-01-01 epoch instead). The signature is HMAC-SHA1 over payload.timestamp using a key derived from the app’s SECRET_KEY and the salt cookie-session.
For CTF challenges the typical workflow is:
- Decode the cookie to read what role / user is currently set (often something like
{"is_admin": false}). - Find the
SECRET_KEY(leaked source, debug page, environment variable, weak guess). - Verify the signature here to confirm the secret is correct.
- Forge a new cookie with
flask-unsignon the command line:flask-unsign --sign --cookie "{'is_admin': True}" --secret '...'.
When the cookie includes auth-relevant fields (admin role, user id, CSRF token), look at related tools: the JWT Decoder for token-based auth, URL Encoder for cookies that wrap percent-encoded data, and the Checksum Calculator if the secret is leaked as a hash.
Challenges that use this tool
- Old SessionspicoCTF 2026 · Web Exploitation · Easy
- Cookie Monster Secret RecipepicoCTF 2025 · Web Exploitation · Easy
- Power CookiepicoCTF 2022 · Web Exploitation · Medium
- CookiespicoCTF 2021 · Web Exploitation · Easy
- More CookiespicoCTF 2021 · Web Exploitation · Medium
- Most CookiespicoCTF 2021 · Web Exploitation · Medium
- Who are you?picoCTF 2021 · Web Exploitation · Medium
Challenges where it helps
Guides that use this tool
- PHP Type Juggling for CTF: Magic Hashes, Array Tricks, and What PHP 8 BrokeLoose comparison bugs in PHP, from 0e magic hashes to passing arrays into strcmp, plus which classic tricks PHP 8 killed and which ones still work in 2026.
- The picoCTF Web Exploitation Roadmap: Recon to RCEWeb exploitation roadmap: how to learn web hacking in order, a difficulty-tiered path classifying every bug by where your input lands, with technique guides.
- CSRF for CTF: Forging Requests and Bypassing TokensBeat the admin-bot CSRF challenge: host an auto-submitting form, understand SameSite, bypass weak anti-CSRF tokens, and chain XSS when the cookie will not ride.
- Authentication Bypass and IDOR for CTF: The Broken Access Control PlaybookAuth bypass and IDOR for CTF: delete client-side login checks, tamper cookies and hidden fields, guess defaults, increment IDs, and force-browse to admin pages.
- NoSQL Injection for CTF: Bypassing Login Without SQLNoSQL injection: bypass a MongoDB login with $ne, $gt, and $regex operators, blind extraction one char at a time, $where eval, plus a payload cheat sheet.
- Insecure Deserialization for CTF: Pickle, __reduce__, and RCEInsecure deserialization: why loading a pickle file runs code, and how the Python __reduce__ exploit that solves a CTF is the same RCE pwning AI infra in 2026.
Tools that pair with this one
- JWT DecoderDecode JSON Web Tokens and inspect the header, payload, and signature. Useful for web exploitation challenges.
- Base64 & Base32 DecoderDecode Base64 and Base32 strings with auto-detection. Multi-layer mode unwraps nested encodings automatically.
- Hash IdentifierIdentify unknown hash types by length and prefix. Covers MD5, SHA-1, SHA-256, SHA-512, bcrypt, NTLM, and more.
- URL Encoder / DecoderEncode and decode URL-encoded (percent-encoded) strings. Useful for web exploitation challenges involving query parameters, form data, and HTTP headers.
Or browse all 40 CTF tools.