Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Max Number of Cookies 1

Status
Not open for further replies.

rtshort

IS-IT--Management
Feb 28, 2001
878
US
Is there a maximum number for cookies and if so, what is it? Rob
Just my $.02.
 
Thanks sfriday, that's about what I'm looking for, but I don't understand what is meant by the statement, "a single domain can only set 20 cookies". I'm filling about 25 combo boxes and need to set a cookie for each one so I can pass the value to another page using the Server.Execute method. Is there another way to pass the value using Server.Execute?
Rob
Just my $.02.
 
"a single domain can only set 20 cookies" - means that any pages included in a domain (i.e. a website, like "xyz.com") may collectively set 20 cookies. For instance, I may set a total of 20 cookies from my website (regardless of which pages set them).

One method for "extending" this limit, is to combine your (25) pieces of info into one string (comman delimited?), and use a single cookie to store it. Of course, you'll need to take it apart to read it (try the SPLIT() method), but at least you can get around the 20 cookie limit.

Last I checked, Internet Explorer did not enforce the 20 cookie limit - but I haven't looked at it in a while - does anyone know if this is still true?
 
Thanks for breaking it down for me Kim. That would mean that I couldn't set over 20 cookies on anyones machine then, unless I workaround it as you suggested. If I use them as follows, does that count for 1 cookie?

response.cookies("Engine")("EngType")
response.cookies("Engine")("EngMake")
response.cookies("Engine")("EngModel")
response.cookies("Engine")("EngHP")
response.cookies("Engine")("EngYear")
response.cookies("Engine")("EngSerNo")

Thanks for your time. Rob
Just my $.02.
 
Yes - it does count as 1 cookie (please forgive me, I've been doing cookies with JavaScript recently - and had spaced the ability to work with keys in ASP).

You will need to set the values you want associated with the keys you've set up:

response.cookies("Engine")("EngType") = value
etc.

The size limit should hold true however, a single cookie is supposedly limited to 4K total size. Again, I'm not sure if IE enforces this limit???
Hope this helps.
Ciao, K----------------
"If you were supposed to understand it, we wouldn't call it code" - FedEx
 
Thanks a million Kim!!!!!!
You saved me. Rob
Just my $.02.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top