IE8 blocking JavaScript Cookies
- by ossreleasefeed
Hey there folks,
Here is one that is throwing me for a loop. I am trying to set a simple cookie that has one name:value pair on IE8. Tested on FF and it works fine. IE8 keeps blocking it.
I have read about the P3P stuff and created a basic P3P doc, no errors reported by the IBM tool, and added the following on all pages:
<meta http-equiv="P3P" CP="CAO DSP COR PSDa CONi TELi OUR STP COM NAV"><link rel="P3Pv1" href="/w3c/p3p.xml"></link>
The code I use to set the cookie is as follows:
function setCompatibilityCookie(c_name, value, expiredays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + expiredays);
document.cookie= c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires=" + exdate.toUTCString());}
Any ideas why IE8 keeps blocking me from setting this cookie?
Thank you,
Schalk