我的网站托管在两个域中:
在foo.mydomain.com中,我想使用src =“ bar.mydomain.com”打开一个iframe,然后访问它的cookie。有可能吗?
最终目标是在iframe中成功登录后检索JSESSIONID cookie。
目前,我已经尝试过
iframe.onload = () => {
var signInForm = iframe.contentWindow.document.getElementById("signInForm");
console.log(signInForm)
};
但是我遇到了 SecurityError:使用Firefox无法访问跨域对象上的属性“ document” 。