I. The Browser allows the number of cookies contained in each domain name:
Microsoft pointed out that internetexplorer8 adds a cookie limit of 50 for each domain name, But IE7 also seems to allow 50 cookies for each domain name.
Firefox has a maximum of 50 cookies for each domain name.
Opera has a maximum of 30 cookies for each domain name.
Safari/WebKit seems to have no cookie restrictions. However, if there are many cookies, the header size will exceed the server's processing limit, which may cause errors.
Note: "Each domain name has 20 cookies" is no longer correct!
2. When many cookies are set, how does the browser respond.
Besides Safari (you can set all cookies regardless of the number of cookies), there are two methods:
Least recently used (leastrecentlyused (LRU) method: When the cookie has reached the limit, the oldest cookie is automatically kicked out to make some space for the latest cookie. Internetexplorer and opera use this method.
Firefox is unique: although the last set cookie is always retained, it seems that it randomly determines which cookies are retained. There seems to be no plan (we recommend that you do not exceed the cookie limit in Firefox ).
3. Different browsers have different cookie sizes:
Firefox and Safari allow cookies to contain up to 4097 bytes, including names, values, and equal signs.
Opera allows cookies to contain up to 4096 bytes, including name, value, and equal sign.
Internetexplorer allows cookies to contain up to 4095 bytes, including name, value, and equal sign.
Note: Multi-byte characters are calculated as two bytes. In all browsers, any cookie that exceeds the limit is ignored and never set.