To tell you the truth, in the normal use of JS rarely to pay attention to this aspect of the problem is rarely used to cookies, so this time was asked a stunned, squeak and can not say a reason to come, and finally can only be honest to tell the operation of this cookie is not very understanding. Today, some colleagues asked about cookies, I went to the internet to do some of the relevant summary record down, for the time being. About the operation of cookies, as a JS programmer should be relatively familiar with some, so do not give it too much explanation.
Here are the different restrictions on cookies between browsers:
|
IE6.0 |
ie7.0/8.0 |
Opera |
Ff |
Safari |
Chrome |
Number of cookies: |
Each domain is 20 |
Each domain is 50 |
Each domain is 30 |
Each domain is 50 |
No limit on number |
Each domain is 53 |
Total Cookie Size: |
4,095 bytes |
4,095 bytes |
4,096 bytes |
4,097 bytes |
4,097 bytes |
4,097 bytes |
Processing operations after the number limit is exceeded:
1, IE and opera's processing is the same. They all use the "least recently used algorithm", which automatically excludes the oldest cookie when the cookie has reached the limit to give the latest cookie a space to leave available.
2, FF is very special, although the last set of cookies will be preserved, but it seems that there is no random shuffle to delete existing cookies.
Note:
When we do the page cookie operation, we should try to ensure that the number of cookies and the corresponding size. The number of cookies is best < 20~30; Cookie size Best < 4K