-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
secure cookie is encoded to base64 twice #36
Comments
I'm not speaking for the authors, but given that the cookie is structured text (pipe-delimited in this case), the first encoding ensures that the data does not contain the delimiting character. This protects a user from surprising decode failures if the data they're storing in the cookie happens to include the delimiter, no? |
That's a good point... The downside is that when you do this you blow up the cookie size and we started hitting the 4k-ish limit. |
A hack around this would be to prefix the thing with indices of each of the pieces of data. |
That would be a breaking change at this point (aka unable to parse existing If you are storing reasonably large amounts of data in a cookie, have you On Wed, Jan 27, 2016 at 10:20 AM Miek Gieben notifications@github.com
|
Closing due to inactivity. A fix would be breaking. |
On https://github.com/gorilla/securecookie/blob/master/securecookie.go#L272, there is
and a few lines down it is encoded again to base64.
Why is it encoded to base64 on line 272? The raw bytes of b can be used to run the HMAC, it does not have to ascii.
The text was updated successfully, but these errors were encountered: