Search code examples
javascriptbrowsercookiescross-browserlimit

What are the current cookie limits in modern browsers?


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?


Solution

  • Here's a handy tool to test it: http://browsercookielimits.iain.guru/

    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 just reran all tests for Mozilla Firefox 115.6.012.0esr :

    19:21:19.647: Starting
    19:21:19.944: Count: Gave up counting cookies with Character Length 3 and character "1": 1000
    19:21:20.495: Size: Max Cookie Character Length using character "1": 4097
    19:21:29.367: Count: Gave up counting cookies with Character Length 4097 and character "1": 1000
    19:21:29.719: Size: Max Cookie Character Length using character "ÿ": 2049
    19:21:41.710: Count: Gave up counting cookies with Character Length 2049 and character "ÿ": 1000
    19:21:42.319: Count: Gave up counting cookies with Character Length 100 and character "1": 1000
    19:21:42.713: Count: Gave up counting cookies with Character Length 10 and character "1": 1000
    19:21:43.112: Count: Gave up counting cookies with Character Length 5 and character "1": 1000
    19:21:43.231: Guessing Max Cookie Count Per Domain: NA
    19:21:43.231: Guessing Max Cookie Size Per Cookie: 4097 bytes
    19:21:43.232: Guessing Max Cookie Size Per Domain: NA
    

    This answer is pretty old, but I just updated it. Hope it helps.