Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeSignedCookie ¶
func DecodeSignedCookie(secretKeyBase string, decodedCookie string, cookieName string) (map[string]any, error)
DecodeSignedCookie decrypts a Rails 7.1+ encrypted cookie using the provided secretKeyBase and validates that its purpose matches the given cookieName. It returns the decoded session payload (the JSON contained in _rails.message).
The Rails encrypted cookie format is: base64(data)--base64(iv)--base64(authTag) Key derivation: PBKDF2-HMAC-SHA256(secret_key_base, "authenticated encrypted cookie", 1000, 32) Cipher: AES-256-GCM, AAD: empty
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.