Guest_imported
New member
- Jan 1, 1970
- 0
I am trying to set multiple cookies using javascript. But the problem is: instead of creating a second cookie, the code appends it to the first one.
here is my code:
function SetCookie (name,value,expires) {
document.cookie = name + "=" + escape (value) +
((expires) ? "; expires=" + expires.toGMTString() : ""
}
var urlstring1 = "loaded=1"
var urlstring2 = "loaded=2"
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000)); // 24 hrs from now
SetCookie ("urlcoded1", urlstring1, expdate);
SetCookie ("urlcoded2", urlstring2, expdate);
thank you in advance for your help.
campite
here is my code:
function SetCookie (name,value,expires) {
document.cookie = name + "=" + escape (value) +
((expires) ? "; expires=" + expires.toGMTString() : ""
}
var urlstring1 = "loaded=1"
var urlstring2 = "loaded=2"
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000)); // 24 hrs from now
SetCookie ("urlcoded1", urlstring1, expdate);
SetCookie ("urlcoded2", urlstring2, expdate);
thank you in advance for your help.
campite