现代浏览器中当前的 cookie 限制是什么? [英] What are the current cookie limits in modern browsers?
问题描述
截至 2011 年,现代浏览器的通用 cookie 限制是什么?我特别感兴趣:
What are the generic cookie limits for modern browsers, as of 2011? I'm particularly interested in:
- 单个 cookie 的最大大小
- 每个主机/域名 + 路径的最大 cookie 数量
- 每个主机/域名的最大 cookie 数量
- 给定浏览器中所有 cookie 的最大数量/最大总大小
我知道 RFC 2109 规定:
- 至少 300 个 cookie
- 每个 cookie 至少 4096 字节(根据 Set-Cookie 标头的语法描述中构成 cookie 非终结符的字符大小来衡量)
- 每个唯一的主机名或域名至少有 20 个 cookie
但什么是现实世界的规格?
but what are real-world specs?
推荐答案
这里有一个方便的工具来测试它:http://browsercookielimits.iain.guru/
Here's a handy tool to test it: http://browsercookielimits.iain.guru/
它揭示了很多关于 cookie 的内部细节.单击为当前浏览器运行测试";结果(只需要一点时间).
It reveals quite a lot about the internal details regarding cookies. Click "Run Tests for Current Browser" for the results (it only takes a moment).
例如,我为 Google Chrome 10.0.648.134 beta 运行了所有测试:
For example, I ran all tests for Google Chrome 10.0.648.134 beta:
22:23:46.639: Starting
22:23:47.345: Count: Max Cookie count with Character Length 3 and character "1": 180
22:23:50.131: Size: Max Cookie Character Length using character "1": 4096
22:23:52.347: Count: Max Cookie count with Character Length 4096 and character "1": 180
22:23:54.517: Size: Max Cookie Character Length using character "ÿ": 2049
22:23:57.450: Count: Max Cookie count with Character Length 2049 and character "ÿ": 180
22:23:59.41: Count: Max Cookie count with Character Length 100 and character "1": 180
22:24:0.535: Count: Max Cookie count with Character Length 10 and character "1": 180
22:24:2.88: Count: Max Cookie count with Character Length 5 and character "1": 180
22:24:2.886: Guessing Max Cookie Count Per Domain: 180
22:24:2.887: Guessing Max Cookie Size Per Cookie: 4096 bytes
22:24:2.887: Guessing Max Cookie Size Per Domain: NA
这个答案已经很老了,但我只是检查了最新 Chrome 版本的结果,它们基本上是一样的.更新了 Chrome 54.0.2840.98(64 位)的答案.
This answer is pretty old, but I just checked results for the latest Chrome version, and they're essentially the same. updated the answers for Chrome 54.0.2840.98 (64-bit).
这篇关于现代浏览器中当前的 cookie 限制是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!