Can one domain generate multiple cookies on visitor's web browser? If so, when user vists the website, which cookies will be delivered to server? And why would a website generate multiple cookies?
I checked my Google Chrome Browser's Cookies settings, found that there are multiple cookies of nytimes.com.
If server wants to store multiple key/value pairs in cookies, can't they be stored in the same cookies?
To be safe, it's best to stick with 30 to 50 maximum cookies per domain.
If multiple cookies of the same name match a given request URI, one is chosen by the browser. The more specific the path, the higher the precedence. However precedence based on other attributes, including the domain, is unspecified, and may vary between browsers.
If you want to support most browsers, then do not exceed 50 cookies per domain, and 4093 bytes per domain. That is, the size of all cookies should not exceed 4093 bytes. Cookies are sent on every request for a domain, this includes images.
Data size limited by browsers (typically < 4 KB). A server can define multiple cookies with different names, but browsers limit the number of cookies per server (around 50).
Yes :)
I would speculate that the cookies were created by separate components of the website, which were created by separate teams of developers. We, of all people, should realize that this is often the case when we need to get some development done but do not have time to wait for collaboration or for another team to develop a necessary layer for us.
From wikipedia:
Relevant count of maximum stored cookies per domain for the major browsers are:
- Firefox 3.0: 50
- Opera 9: 30
- Internet Explorer 7: 50
Can one domain generate multiple cookies on visitor's web browser?
Yes. The exact limit depends on the browser, Internet Explorer used to accept 20 but increased this to 50.
If so, when user vists the website, which cookies will be delivered to server?
All of them
And why would a website generate multiple cookies?
So that you don't need to serialise all the data (which could be from unrelated parts of the system) in one cookie.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With