Re:Web Development in Go
by positr0n on Monday April 10, 2017 @01:12PM
(#14080460)
Is the flash message setup a standard way implement that type of functionality?? Encrypting the cookie with a key that is delivered client side anyway seems like it doesn't buy you anything.
[ Parent
| on HN ]
Re:Web Development in Go
by kevinburke on Monday April 10, 2017 @01:14PM
(#14080497)
The key isn't sent to the client.
You can set the flash message in plain text, but I'd rather avoid the possibility of tampering, and it lets me reuse the same cookie code I use to encrypt e.g. session tokens.
What kind of tampering are you thinking about here? Aren't those messages sent from the server to the client? Thus, in-transit tampering should be prevented by TLS.
If the key isn't sent to the client, how is the client supposed to display that message? Why are these messages encoded into a cookie in the first place? I don't think I understand the concept.
Re:Web Development in Go
by kevinburke on Tuesday April 11, 2017 @05:32AM
(#14086133)
The message is read on the server as part of the next request and then displayed in the appropriate spot in thr UI