The standard explicitly allows the implementation of limits for the number
of cookies of one site and the total amount of bytes. For good reasons.
Surely nobody wants a website to save large amounts of data on his own
volume. Therefore cookies, if really needed, should only hold a reference to
a database in which the data are stored.
I can't imagine, what a 4k-cookie should be used for. But maybe there's
another way to store data besides cookies. If you like to store the data
only for the session duration, you could save them in a JavaScript Object.
Greetings
Hans
----- Original Message -----
From: "Vlad" <vlad@d...>
To: "javascript" <javascript@p...>
Sent: Tuesday, January 09, 2001 10:04 AM
Subject: [javascript] I.E 5 Cookie problem
> When the total number of characters across all the cookies for a
> particular domain reaches around 4k, IE5.00 appears to wipe the content of
> all the cookies out when you attempt to write to the cookie with client
> code. It seems to be treating the contents of the document.cookie as a
> single cookie rather than the multiple cookies that I have put in there.
> Netscape 4.6 behaves perfectly well (for a change).
>
> Here's some down code that reproduces the problem:-
> file://lets first fill up some strings to put in the cookies
> var i;
> var string1="";
> var string2="";
> for(i=0;i<2200;i++)
> {
> string1+="1";
> string2+="2";
> }
> file://set the first cookie to string1;
> document.cookie = "cookie1="+escape(string1);
> file://lets see how big the cookie is now
> alert("total cookie length="+document.cookie.length);
> file://set the second cookie to string2;
> document.cookie = "cookie2="+escape(string2);
> file://lets see how big the cookie is now should be zero as it's been
wiped out
> alert("total cookie length="+document.cookie.length);
>
>
> If any could help me to write multiple cookies totalling more than 4k I
> would be SO grateful.
>
>
---
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS? Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development,
Web Development, Networking & Communications, and Hardware & Systems.
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---
You are currently subscribed to javascript as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-javascript-$subst('Recip.MemberIDChar')@p2p.wrox.com