简体   繁体   English

如何从JavaScript中的另一个跨域URL读取Cookie

[英]How to read cookie from another cross domain url in javascript

I have a cross domain url in which if I access directly, I can see cookies(from Resources->Cookies in chrome browser). 我有一个跨域网址,如果我直接访问它,我可以看到cookie(从chrome浏览器中的Resources-> Cookies)。

I have created a separate HTML file in which whenever the HTML file page loads, I need to get the cookie from that url. 我创建了一个单独的HTML文件,每当加载HTML文件页面时,我都需要从该URL获取cookie。

Is it possible through javascript? 是否可以通过javascript?

You can not read the cookies from cross domain url, unless the website has explicitly allowed it. 除非网站明确允许,否则您不能从跨域URL中读取Cookie。 (that is very rare) (非常罕见)

Generally You can not do it. 通常, 您无法做到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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