spicymango
Programmer
Hi,
I am reading and setting cooie like the following
When I set cookie I do not set path, will it cause and problem?
Secondly I do not set domain what difference will it make, I see that cookie geting set under the domain which I am hitting
I am reading and setting cooie like the following
Code:
function SetIntroPageCookie() {
cookieName = "intropage";
cookieValue = "Yes";
nDays= 365;
var today = new Date();
var expire = new Date();
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie = cookieName+"="+escape(cookieValue)
+ ";expires="+expire.toGMTString();
}
function readIntroPageCookie() {
name= "intropage";
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
When I set cookie I do not set path, will it cause and problem?
Secondly I do not set domain what difference will it make, I see that cookie geting set under the domain which I am hitting