DistillingExperts
asked on
Cookie not being saved in IE 8
This function is not saving the data in the Internet Temporary Files folder. Any reason why (Windows 7, IE 8)?
function setCookie(name, value, expires, path, domain, secure)
{
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;
}
function setCookie(name, value, expires, path, domain, secure)
{
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;
}
Make sure that cookies is not disabled on IE.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Next, have you checked if these expires in other browsers because you only mention IE8. If it is OK in other browsers then check the following items which are known to cause cookie problems for IE
1. What is the server's clock showing for time. If the server's clock is different from yours IE will expire the cookie
2. Does the website contain an underscore in the domain name? If so then IE tends to drops sessions and cookies
Try that lot out and post back with the results.