Unable to access cookies set by another Domain in IE

后端 未结 5 564
情深已故
情深已故 2020-12-20 21:53

I am setting the cookie from a local HTML file as below using cookie.js library

$.cookies.set(\"Demo\",\"Dummy Data\");

From another doma

5条回答
  •  盖世英雄少女心
    2020-12-20 22:32

    Indeed, this is not possible because of SOP (Same Origin Policy).

    You can solve this problem with cross domain methods like: postMessage, JSONP, xmlHttpRequest or iframe to name a few.

    However, you have to be concerned about security issues. This podcast explain how to breack cross domain barrier. The posts below also have solutions for your problem.

    Stackoverflow Posts

    1. How do I set cookies from outside domains inside iframes in Safari?;
    2. Resizing an iframe based on content;

提交回复
热议问题