Cookie size limit

Source: Internet
Author: User

1. The Browser allows each domain name to containCookieQuantity:

Microsoft notes that internetexplorer8 is addedCookieRestrictions50 for each domain name, But IE7 seems to allow 50 for each domain nameCookie.

Firefox Domain NameCookieRestrictions50.

Each domain name of OperaCookieRestrictions30.

Safari/WebKit does not seem to haveCookieRestrictions. However, ifCookieA large number of headersSizeExceeds the server's processingRestrictions.

Note: "Each domain nameCookieRestrictions"20" is no longer correct!

2. When manyCookieIs set and how the browser responds.

Except Safari (you can set allCookieRegardless of the quantity), there are two methods:

Least recently used (leastrecentlyused (LRU) method: WhenCookieThe quota has been reached, and the oldest one is automatically kickedCookieTo give the latestCookieSome space. Internetexplorer and opera use this method.

Firefox is unique: although the last settingCookieAlways retained, but it seems to be randomly determinedCookieRetained. There seems to be no plan (we recommend that you do not exceedCookieRestrictions).

3. Different browsersCookieTotalSizeAlso different:

Firefox and Safari allowCookieUp to 4097 bytes, including name, value, and equal sign.

Allowed by OperaCookieUp to 4096 bytes, including name, value, and equal sign.

Internetexplorer allowedCookieUp to 4095 bytes, including name, value, and equal sign.

Note: Multi-byte characters are calculated as two bytes. In all browsers, anyCookieSizeExceedsRestrictionsAre ignored and never set. (That isCookie will be invalid)

In addition, the browser also limits the number of cookies that the site can store on the user's computer. Most browsers only allow 20 cookies to be stored on each site;Note that the 20 values here refer to the primary key value, that is, 20 cookies. However, each cookie record can contain several subkeys.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.