I’ve been working on a project in which I needed to use cookies for storing data. This sounds like a pretty easy thing - what problem this can be?!? But the cookies were much more then the usual case as a number, maybe about 30. Yes, I know when having so much data it is better to store it in database, but that wasn't my case. I know this may sound ridiculous, but I did not have another choice.
Guess what? I found that there is some problem with IE6 and IE7 - not all of my cookies were stored but just some part of them. Mozilla Firefox and Opera were fine and working as they have to.
So after big wondering where is my mistake I found in a web blog and thanks to Dave there was the great problem decision... Here are some facts for cookies...
Most of the documentation suggests that web browsers must support a minimum of:
But IE has maximum limit of 20 cookies per domain. If you set a 21st cookie for a given domain, then the 1st cookie is forgotten - so only the most recently-created 20 cookies are kept.
The real problem, however, comes when you try and set cookies with a large size. The standards state that a browser must support a minimum of 4096 bytes per cookie. IE6 doesn’t do this. Instead, it seems to have a maximum size of 4096 bytes for all cookies from a domain. And, even worse, once this maximum is exceeded, you can’t read or write any further cookies for that domain. The only solution is for the user to “Delete cookies…” from Tools > Internet Options > General, and start again.
So have this in mind if you plan to use many many cookies as me for you work!!
Comments
Add your comment here.
What is this blog about? - A blog about sharing wisdoms mostly connected with web development.
I truly hope that you will find something useful here. Cheers, Raya.
i was using cookies in a shopping cart module to add items in cart. I was placing data i.e item id, quantity and price in cookies when i had added 15 item in cart. It get started to lose data in cookies. I think no of cookies had been increased against the browser supported limit. This is really a big problem for cookies.