每个浏览器的最大 cookie 数量(不是每个主机名)
有谁知道浏览器在所有域中可以保存的 cookie 数量是否有最大数量?有谁知道现代浏览器的这些最大值和默认设置是多少?
例如,本文指出 FireFox 3 的默认值为 1000,并且该值位于 network.cookie.maxNumber 设置中: https://developer.mozilla.org/en/Cookies_Preferences_in_Mozilla
当我转到 about:config 时我的 FF7,我没有看到 network.cookie.maxNumber 的设置。这被删除了吗? Firefox 不再有最大值了吗?设置更改名称了吗?
Chrome、Safari 和 IE 怎么样?
需要明确的是,我对每个主机的最大数量不感兴趣,而是对所有主机感兴趣。
Does anyone know if there is a maximum number of cookies that a browser can hold, across all domains? Does anyone know what these maximums are for modern broswers and the default settings?
For example, this artcle states that FireFox 3 had a default of 1000 and that this was in the network.cookie.maxNumber setting:
https://developer.mozilla.org/en/Cookies_Preferences_in_Mozilla
When I go to about:config in my FF7, i don't see a setting for network.cookie.maxNumber. Was this removed? Is there no maximum anymore in Firefox? Did the setting change names?
What about Chrome, Safari, and IE?
To be clear I am not interested in maximum per host, but for all hosts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
每个浏览器允许的最大 cookie 数量差异很大,唯一确定的方法是执行一些测试(如果您不拥有多个域,这将很难)。 RFC 2109 设置了 Cookie 的一些最小值(每个用户代理至少 300 个,每个 4096 字节) ,但没有最大值。 IE6 不尊重这一点。
以下是 Firefox 的(可能已过时)列表: http://www .ghacks.net/2008/08/16/browser-cookie-limits/
The maximum allowed cookies per browser varies heavily per browser, and the only way to know for sure would be to perform some tests (which would be hard if you don't own multiple domains). RFC 2109 sets some minimums for cookies (at least 300 per user agent at 4096 bytes each), but no maximums. IE6 does not honor this.
Here is a (probably outdated) list for Firefox: http://www.ghacks.net/2008/08/16/browser-cookie-limits/
据我所知,这些都没有真正正式记录。这是我所知道的:
CookieMonster::kMaxCookies
) 这似乎也是来自 Firefox 的共享代码。None of this is really officially documented as far as I can tell. Here is what I do know:
CookieMonster::kMaxCookies
) This appears to be shared code from Firefox as well.对于 Firefox,默认情况下不会出现 network.cookie.maxNumber 的配置条目,但如果您自己声明它(about:config -> 右键单击 -> New -> Integer),则可以覆盖它。根据 mozillaZine wiki,network.cookie.maxNumber 的默认值为 1000。
PS,如果有人想知道,每个主机的可比配置值是 network.cookie.maxPerHost
For Firefox, the config entry for network.cookie.maxNumber does not appear by default, but if you declare it yourself (about:config -> right-click -> New -> Integer), you can override it. According to the mozillaZine wiki, the default value for network.cookie.maxNumber is 1000.
P.S. in case anyone wants to know, the comparable config value for per-host is network.cookie.maxPerHost