V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
444683462
V2EX  ›  问与答

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

  •  
  •   444683462 · 2014-12-03 12:15:51 +08:00 · 2497 次点击
    这是一个创建于 3437 天前的主题,其中的信息可能已经有所发展或是发生改变。
    cookies的默认大小限制究竟是多大。网上说是20条??4K??
    3 条回复    2014-12-03 14:13:21 +08:00
    barbery
        1
    barbery  
       2014-12-03 12:21:19 +08:00
    几年前是4K,不过现代浏览器都相应提升了吧,不同浏览器的规则不同
    raincious
        2
    raincious  
       2014-12-03 12:32:42 +08:00   ❤️ 1
    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
        3
    Yo_oY  
       2014-12-03 14:13:21 +08:00
    @raincious 说个跑题的,被你的头像骗到了,还以为V2EX改版了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2234 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 08:10 · PVG 16:10 · LAX 01:10 · JFK 04:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.