现代浏览器目前的Cookie限制是什么? [英] What are the current cookie limits in modern browsers?

查看:268
本文介绍了现代浏览器目前的Cookie限制是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

截至2011年,现代浏览器的常规Cookie限制是什么?我特别感兴趣的是:




  • 单个Cookie的最大大小

  • /主机/域名+路径

  • 每个主机/域名的最大Cookie数量

  • 给定的所有Cookie的最大数量/浏览器



我知道 RFC 2109 指定:




  • 至少300个Cookie

  • 至少4096

  • 每个唯一的主机或域至少要有20个Cookie(每个Cookie的字节数由组成Cookie非终端的字符的大小衡量)名称



但是什么是真实世界的规格?

解决方案

这是一个方便测试的工具: http://browsercookielimits.squawky.net/



它显示了很多关于cookie的内部细节。



例如,我针对Google Chrome 10.0.648.134测试版运行了所有测试:

/ p>

  22:23:46.639:正在开始
22:23:47.345:计数:字符长度为3字符1:180
22:23:50.131:大小:使用字符1的最大Cookie字符长度:4096
22:23:52.347:计数:字符长度为4096 1:180
22:23:54.517:大小:使用字符ÿ的最大Cookie字符长度:2049
22:23:57.450:计数:字符长度为2049的最大Cookie计数, ÿ:180
22:23:59.41:计数:字符长度100和字符1的最大Cookie计数:180
22:24:0.535:计数:字符长度为10的Cookie计数字符1:180
22:24:2.88:计数:字符长度5和字符1的最大Cookie计数:180
22:24:2.886:猜测每个域的最大Cookie计数:180
22:24:2.887:猜测每个Cookie的最大Cookie大小:4096字节
22:24:2.887:猜测每个域的最大Cookie大小:NA
pre>




这个答案很老,但我刚刚检查了最新Chrome版本的结果,相同。
编辑:更新Chrome 54.0.2840.98(64位)的答案。


What are the generic cookie limits for modern browsers, as of 2011? I'm particularly interested in:

  • Max size of a single cookie
  • Max number of cookies per host/domain name + path
  • Max number of cookies per host/domain name
  • Max number / max total size of all cookies in a given browser

I'm aware of RFC 2109 that specifies:

  • 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

but what are real-world specs?

解决方案

Here's a handy tool to test it: http://browsercookielimits.squawky.net/

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).

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


This answer is pretty old, but I just checked results for the latest Chrome version, and they're essentially the same. Edit: updated the answers for Chrome 54.0.2840.98 (64-bit).

这篇关于现代浏览器目前的Cookie限制是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆