简体   繁体   English

如何获得来自其他域的响应中的Cookie?

[英]How can I get a cookie that came in a response from a different domain?

I'm sending an AJAX request to another domain, and it's sending me a response with a cookie, but document.cookie is empty. 我正在向另一个域发送AJAX请求,并且正在向我发送一个包含cookie的响应,但document.cookie为空。 How can I make it visible? 如何使其可见? What permissions do I need? 我需要什么权限? Thanks. 谢谢。

What you're attempting can't be done. 您尝试的操作无法完成。 (It's a browser security issue) (这是浏览器的安全问题)

can only be solved by getting the user's browser to submit requests to each domain which will then set its own cookie. 只能通过使用户的浏览器向每个域提交请求来解决,然后再设置自己的cookie。

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

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