cookies 的默认大小限制究竟是多大。网上说是 20 条??4K??

2014-12-03 12:15:51 +08:00
 444683462
cookies的默认大小限制究竟是多大。网上说是20条??4K??
2509 次点击
所在节点    问与答
3 条回复
barbery
2014-12-03 12:21:19 +08:00
几年前是4K,不过现代浏览器都相应提升了吧,不同浏览器的规则不同
raincious
2014-12-03 12:32:42 +08:00
Practical user agent implementations have limits on the number and
size of cookies that they can store. General-use user agents SHOULD
provide each of the following minimum capabilities:

o At least 4096 bytes per cookie (as measured by the sum of the
length of the cookie's name, value, and attributes).

o At least 50 cookies per domain.

o At least 3000 cookies total.

RFC6265: HTTP State Management Mechanism
http://tools.ietf.org/html/rfc6265

这里说的是SHOULD,因此你不能断定某些脑残浏览器会怎么定义自己的策略。不过按照这个标准执行不会错,忽略那些浏览器就好。
Yo_oY
2014-12-03 14:13:21 +08:00
@raincious 说个跑题的,被你的头像骗到了,还以为V2EX改版了。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/151180

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX