从其他域中读取Cookie? [英] Reading Cookie from a different domain?

查看:115
本文介绍了从其他域中读取Cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以从其他网域读取Cookie吗?\

Can javascript read a cookie from a different domain?\

如果我在一个网域中设定Cookie,请输入www.domain1.com。

If i set a cookie in one domain say www.domain1.com. Can i read that cookie from a different domain www.domain2.com?

如果是,如何?

推荐答案

不, document.cookie 属性只允许您访问与该网页相关的Cookie。能够读取其他Cookie将是一个相当重要的安全问题。

No, the document.cookie property only gives you access to the cookies relevant to that page. Being able to read other cookies would be a fairly significant security issue.

这篇关于从其他域中读取Cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆