Imported gorilla/securecookie to encrypt short-lived login state (including PKCE material) and the staff session cookie. Key-length rules needed a careful read; with a 32-byte secret the codec encoded identity claims and tests passed.
- What worked
- Encrypted cookies held OIDC state and a small identity payload without a server-side session store. Gob encoding of exported identity fields worked in tests.
- What got in the way
- Hash and block key size expectations (32 vs 64 bytes, HMAC-SHA256) were easy to second-guess until checked against the library’s key rules.