Home Web Front-end JS Tutorial Questions about the number and size of COOKIE_javascript skills

Questions about the number and size of COOKIE_javascript skills

May 16, 2016 pm 06:11 PM
cookie number size

To be honest, I rarely pay attention to this issue in my daily use of JS and rarely use cookies, so I was dumbfounded when I was asked this time. I couldn't explain why, so in the end I just said: I can honestly admit that I don’t know much about the operation of this cookie. Today, a colleague asked about cookies again, so I checked online and made some relevant summaries and recorded them for future reference. As a JS programmer, you should be relatively familiar with the operation of cookies, so I won’t explain it too much.

The following are the different restrictions on cookies between browsers:

IE6.0

 

IE6.0

IE7.0/8.0

Opera

FF

Safari

Chrome

cookie个数:

每个域为20个

每个域为50个

每个域为30个

每个域为50个

没有个数限制

每个域为53个

cookie总大小:

4095个字节

4095个字节

4096个字节

4097个字节

4097个字节

4097个字节

IE7.0/8.0

Opera

FF

Safari

Chrome

Number of cookies:

20 for each domain

50 for each domain

30 for each domain

50 for each domain

No limit on number

53 for each domain

Total cookie size:

4095 bytes

4095 bytes

4096 bytes

4097 bytes

4097 bytes

4097 bytes

Processing operations after the number limit is exceeded: 1. The processing of IE and Opera is the same. They all use the "least recently used algorithm". When the cookie limit has been reached, the oldest cookies will be automatically removed to leave available space for the newest cookies. 2. FF is very special. Although the last cookie set will be retained, it seems to have no rules to randomly delete existing cookies. Remarks: When we perform page cookie operations, we should try to ensure the number and corresponding size of cookies. The best number of cookies is < 20~30; the best cookie size is < 4K
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Where are cookies stored? Where are cookies stored? Dec 20, 2023 pm 03:07 PM

Where are cookies stored?

Where are the cookies on your computer? Where are the cookies on your computer? Dec 22, 2023 pm 03:46 PM

Where are the cookies on your computer?

How to increase disk size in VirtualBox [Guide] How to increase disk size in VirtualBox [Guide] Mar 17, 2024 am 10:10 AM

How to increase disk size in VirtualBox [Guide]

Where are the mobile cookies? Where are the mobile cookies? Dec 22, 2023 pm 03:40 PM

Where are the mobile cookies?

What are the dangers of cookie leakage? What are the dangers of cookie leakage? Sep 20, 2023 pm 05:53 PM

What are the dangers of cookie leakage?

Detailed explanation of where browser cookies are stored Detailed explanation of where browser cookies are stored Jan 19, 2024 am 09:15 AM

Detailed explanation of where browser cookies are stored

How cookies work How cookies work Sep 20, 2023 pm 05:57 PM

How cookies work

Does clearing cookies have any impact? Does clearing cookies have any impact? Sep 20, 2023 pm 06:01 PM

Does clearing cookies have any impact?

See all articles