Forum Moderators: open

Message Too Old, No Replies

How many Cookies?

How many cookies can I set?

         

neh2008

5:32 am on Jul 19, 2003 (gmt 0)

10+ Year Member



Hi,

I have used sessions so far, and never cookies.

The question is, Is there a limit as to how many cookies can I set on a browser?

If more then one,

Can two cookies from the same server ever conflict with each other? I am running into a 500 error and I think its bcuz of cookies.

Any help would be appreciated.

Neh

jpjones

7:04 am on Jul 19, 2003 (gmt 0)

10+ Year Member



How many cookies can I set on a browser?

The specs say the following:

- 300 total cookies
- Each cookies should be a maximum of 4 kilobytes, where the name and the Cookie Value combine to form the 4 kilobyte limit.
- 20 cookies per server or domain. (note that completely specified hosts and domains are treated as separate entities and have a 20 cookie limitation for each, not combined)

I am running into a 500 error and I think its bcuz of cookies

That's difficult to confirm/deny without looking at your code (please don't post it in its entirety here).
Does your code rely on values read from cookies? If so, then this could be a reason for a 500 error - if the cookie doesn't exist, and then the calculation relying on the cookie value cannot proceed etc.

dmorison

7:39 am on Jul 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since you've got up to 4K per cookie; if you are reaching 20 / domain limit you can always store multiple key/value combos within the one cookie.

I don't know about ASP (VB), but with PHP this is made easy by using the serialize / unserialize functions.

If VB doesn't provide similar functions it should be a relatively straight forward matter to do a string split on some appropriate delimiter and do it yourself.

neh2008

6:47 pm on Jul 25, 2003 (gmt 0)

10+ Year Member



Thank you.

I omitted cookies till now, I am switching back to cookies after knowing all this abot them.

Thanks, people. You are a huge help.

Nehal