Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 774
GreyCat Avatar asked Mar 21 '11 17:03

GreyCat


People also ask

What is the limit of cookies?

According to Microsoft its 4096 bytes. cookies are usually limited to 4096 bytes and you can't store more than 20 cookies per site.

How many cookies are allowed from Google?

Number of Cookies: Chrome 9 allowed 180 cookies per domain.

What is the maximum size of cookie in MB?

The 4K is the maximum size for the entire cookie, including name, value, expiry date etc. To support most browsers, it is suggested to keep the name under 4000 bytes, and the overall cookie size under 4093 bytes.


1 Answers

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

like image 194
Please treat your mods well. Avatar answered Sep 25 '22 01:09

Please treat your mods well.