简体   繁体   English

检查另一个域上是否存在cookie

[英]Check if a cookie exists on another domain

I have actually set the following cookie for the following domain: 我实际上为以下域设置了以下cookie:

setcookie("thing", $data, time()+3600, "/", "example1.com", 1);

The cookie was set from this domain: example2.com Cookie是从以下域中设置的:example2.com

When I try to search for the cookie 'thing' I can't seem to find it. 当我尝试搜索cookie'''时,我似乎无法找到它。 How is it possible to set a cookie on a domain, which will remain on another domain if I search for it? 如何在域上设置cookie,如果我搜索它,它将保留在另一个域上?

UPDATE: 更新:

I basically want to pass a value from Domain A to Domain B. When a visitor arrives to Domain A he/she gets redirected AND pass a value to Domain B which I'd like to capture there. 我基本上想要将域A中的值传递给域B.当访问者到达域A时,他/她被重定向并将值传递给域B,我想在那里捕获它。

How is it possible? 这怎么可能?

Every browser prevents it. 每个浏览器都会阻止它

Cookies can not be shared between domains. Cookie不能在域之间共享。 https://wikipedia.org/wiki/Same-Origin-Policy https://wikipedia.org/wiki/Same-Origin-Policy

I'm pretty sure it is impossible to create a cookie for another domain - this would be a pretty significant security hole. 我很确定不可能为另一个域创建一个cookie - 这将是一个非常重要的安全漏洞。

See @scones' link. 请参阅@scones的链接。

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

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