【问题标题】:How many cookies can we have for a domain?一个域可以有多少个 cookie?
【发布时间】:2011-07-14 00:02:06
【问题描述】:

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

【问题讨论】:

标签: cookies


【解决方案1】:

根据我自己的研究,我建议您不要超过每个域 50 个 cookie,以及每个域 4095 个字节。也就是说,您域中所有 cookie 的大小不应超过 4095 字节。

如果你想了解更多,我已经分享了我的研究here

【讨论】:

  • 链接好像失效了。有人有更新吗?
  • @ChipTol 现已修复
【解决方案2】:

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

实用的用户代理 实施有限制 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

【讨论】:

    【解决方案3】:

    我见过设置超过 450 个 cookie 和 reporting to over 140 distinctive third party domains 的网站。

    【讨论】:

      猜你喜欢
      • 2010-11-11
      • 2016-06-17
      • 2018-12-11
      • 2021-12-11
      • 1970-01-01
      • 2013-08-29
      • 1970-01-01
      • 2013-12-04
      • 2011-07-18
      相关资源
      最近更新 更多