What are allowed characters in cookies?

前端 未结 13 1059
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 03:36

What are the allowed characters in both cookie name and value? Are they same as URL or some common subset?

Reason I\'m asking is that I\'ve recently hit some strange

相关标签:
13条回答
  • 2020-11-22 04:43

    There are 2 versions of cookies specifications
    1. Version 0 cookies aka Netscape cookies,
    2. Version 1 aka RFC 2965 cookies
    In version 0 The name and value part of cookies are sequences of characters, excluding the semicolon, comma, equals sign, and whitespace, if not used with double quotes
    version 1 is a lot more complicated you can check it here
    In this version specs for name value part is almost same except name can not start with $ sign

    0 讨论(0)
提交回复
热议问题