简体   繁体   中英

Internet Explorer not writing to document.cookie?

Ran into something lovely, and intermittent, while trying to write cookies today in an Iframe via javascript.

So say I assign a new cookie:

document.cookie = "key=value;";

Calling said cookie returns as:

document.cookie = "";

I've tried this across both IE 9 and IE10, and it's working for some users, and not others. Same browser versions.

Furthermore, it seems to be machine specific, we're in an enterprise network, and users can log into one machine, and be okay, whilest another station and we'll see this behavior.

I've thought about some group policy, but that last point has me at something of a loss.

Edit: More extra details.

Cookies are allowed on these machines.

This isn't a Session/Persistent Cookie mix up; literally trying to write to the document.cookie object returns "", even if you call it right after assignment.

Here's a big one I missed, I'm trying to assign these as an Iframe , and there doesn't seem to be an issue with P3P headers, as there are machines that are viewing it just fine; same browser versions.

I was experiencing the same problem and found that the users with IE that could not take the cookie had protected mode enabled.

Internet Options/Security/Enable Protected Mode (uncheck)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM