我们可以为域名提供多少个Cookie?

dan*_*els 11 cookies

我知道cookie有多少数据存在限制,但是我们可以设置多少个cookie?

arn*_*ehe 7

来自http://www.ietf.org/rfc/rfc2109.txt

实际的用户代理实现限制了它们可以存储的cookie的数量和大小.通常,用户代理的cookie支持应该没有固定的限制.他们应该努力存储尽可能多的常用cookie.此外,通用用户代理应单独提供以下每个最低功能,但不一定同时:

  * at least 300 cookies

  * at least 4096 bytes per cookie (as measured by the size of the
    characters that comprise the cookie non-terminal in the syntax
    description of the Set-Cookie header)

  * at least 20 cookies per unique host or domain name
Run Code Online (Sandbox Code Playgroud)


Iai*_*ain 7

根据我自己的研究,我建议你不要超过每个域50块饼干,和每个域4095个字节.也就是说,域中所有cookie的大小不应超过4095字节.

如果你想了解更多,我在这里分享了我的研究.