Should cookie values be URL encoded?

前端 未结 3 918
你的背包
你的背包 2020-12-10 03:25

When setting cookies, PHP url-encodes the cookie value (at least when not using setrawcookie) and it url-decodes the cookie value before making

3条回答
  •  温柔的废话
    2020-12-10 03:52

    sytech's answer (which I have accepted) is certainly correct as it quotes the spec, but since the spec is rather vague, here's an overview how some web frameworks actually handle the matter:

    RFC6265:           "for example Base64"
    PHP:               URL encode
    Go:                raw
    Node.js + Express: URL encode
    

提交回复
热议问题