Read IFrame cookie
Read IFrame cookie
我创建了一个iframe,并在其中加载了一个网站(我没有访问这个网站-它不是由我写的)
<script type="text/javascript">
var el = document.createElement("iframe");
el.setAttribute('id', 'ifrm');
document.body.appendChild(el);
el.setAttribute('src', 'http://AWEBSITE.com/');
alert(document.getElement("iframe").cookie); //This doesnt work.....
</script>
我可以使用javascript以某种方式读取我的cookie的iframe?
由于同源策略,这是不可能的。您真的希望有人能够在任何页面上粘贴iframe,指向任何域,并获得您的cookie吗?
您可以使用下面的代码从iframe
获取cookiedocument.getElementById("iframeName").contentDocument.cookie
相关文章:
- 防止Iframe窗体在新窗口中打开
- 将样式表插入iframe
- Cross protocol cookie iFrame
- 使用 Iframe 问题设置跨域 Cookie
- 是否可以在没有 Cookie 数据的情况下创建 iframe
- Cookie 设置为 iframe javascript 中的父窗口
- JavaScript set cookie via iFrame via CORS via PHP Allow Head
- 使用没有会话或 Cookie 数据的 iFrame(无痕)
- 如何在javascript中读取显示在iframe中的外部网站的cookie
- 无法通过iframe添加cookie
- 如何在 iframe 中设置 cookie?Facebook Cookie 的工作原理
- Windows应用商店应用程序和iFrame cookie
- 删除按Iframe设置的已有Cookie
- 在iframe内执行alert(document.cookie)
- Read IFrame cookie
- 通过文档.从独立域的iframe内将Cookie转换为PHP
- 无法访问在iframe中加载的自己域上的httponly标记的cookie
- 如何在设置iframe时将cookie附加到请求中.SRC(使用jquery)
- Cookie在安卓Webview的iframe中不起作用
- Iframe不能读取或设置cookie