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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cookie problem

Status
Not open for further replies.

Qwark

Programmer
Sep 26, 2000
59
NL
I've a problem with JavaScript and cookies. I have a form with some user data. It's not possible to write more than 18 or 19 form.elements[.....].value into a cookie. I have read that the maximum size of a cookie is 4 kb, My cookie is only 2 kb.

This is my script, I found it on Htmlgoodies.com

if(document.cookie != document.cookie)
// I don't no why I use this if constr. But I 've copy it
// from the manual. When I not use this if it doesn't work
// correctly
{
index=document.cookie.indexOf(inputName);
}
else
{
index=-1;
}

if(index=-1)
{
inputValue=document.bestellen.elements[inputName].value;
document.cookie= "C"+ inputName + "=" + inputValue
+ "; expires=" + expiry.toGMTString();

Can someone help me,

Thanks,

Qwark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top