《Disney +》 迪士尼、Marvel、彼思、星球大戰…  東京遊戲展2021 蘇菲的鍊金工房2 ~不可思議夢的鍊金術士發表   原神1.3版本更新:來海燈節一起歡度提瓦特的新年吧!   【情報解禁】KOF XV新角色「KING」介紹短片公開!   靈感來自JRPG的廣闊MMO《Zenith》即將登陸PS VR   「超級機器人大戰30」第三彈預告片 & DLC②參戰作品發表!ULTRAMAN於超機戰中登場!   萊莎新造型!「萊莎的煉金工房」系列累積銷售 100 萬套紀念服裝免費提供!   多多自走棋S13賽季海洋之旅 7月22日揭開神秘面紗   PS4 賽事:公開系列賽追加三場新賽事 

瀏覽器的 Cookie 容量限制

商業

瀏覽器的 Cookie 是做登入、紀錄、追蹤等等,最常使用的工具。

不過現在 Cookie 要放的東西越來越多,Cookie 到底可以塞的容量是多少呢?

  • 註1:照標準應該是 4096 bytes,不過瀏覽器實作時,都可能會有些落差~
  • 註2:下述取自此篇:RFC-2965 HTTP State Management Mechanism
    • Practical user agent implementations have limits on the number and size of cookies that they can store.
      • at least 300 cookies
      • at least 4096 bytes per cookie (as measured by the characters that comprise the cookie non-terminal in the syntax description of the Set-Cookie2 header, and as received in the Set-Cookie2 header)
      • at least 20 cookies per unique host or domain name

瀏覽器的 Cookie 容量限制 - 2018

IE、Chrome、Firefox、Safari 等等,允許 Cookie 的容量限制是如何,可以參考此篇:chrome cookie size limit(下述摘錄自此篇)

  • According to RFC 1012 cookie size must not be limited by user agent. But the minimum capabilities of a browser or user agent should be at least 4096 bytes per cookie. This limit is applied to the name=value portion of the cookie only.
  • So some browsers can support longer cookies as well. List :
    • Internet Explorer 8 allowed cookies up to 4095 bytes
    • Chrome 9 allowed cookies up to 4096 bytes
    • Opera 11 allowed cookies up to 4096 bytes
    • Safari 5 allowed coookies up to 4097 bytes
    • Firefox 3.6.3 allowed cookies up to 4097 bytes

建議下述此篇必看,這篇有更詳細的「清單」與「即時測試」的功能,此篇除了 Size 外,還有每個 Domain 的 Max Cookie 可以設定的數量在各個瀏覽器版本的資訊。

  • 詳見:Browser Cookie Limits - 大多數都是每個 Cookie size 4096 bytes,每個 Domain Cookie Max size 也是 4096 bytes 上下居多 (更新到 2017年)

相關網頁

Tsung

隨機商業新聞