如何在称其为第三方时提供原点的第一方饼干
假设我拥有一个网站“ cookiemaker.com
”。我希望我的客户端(网站所有者本身)将HTTP请求发送到包括我生成的cookie的服务器。换句话说:
- 最终用户“鲍勃”访问了我的网站cookiemaker.com
- i(
cookiemaker.com
)为他提供了一个cookie,他的浏览器现在存储 - 鲍勃现在正在访问另一个网站(“
cool-recipes.com “)
- 鲍勃在cool-recipes.com中单击一个按钮,然后他的浏览器将http请求发送到
cookiemaker.com
。
有没有办法将在(4)发送的请求中包括在(2)中创建的cookie?
(假设两个网站完全控制)
Suppose I own a website at "cookiemaker.com
". I want my client (website owners themselves) to send HTTP requests to my server that include cookies I generated. In other words:
- End-User "Bob" visits my site at cookiemaker.com
- I (
cookiemaker.com
) provides him with a cookie that his browser now stores - Bob is now visiting another website ("
cool-recipes.com
") - Bob clicks a button within cool-recipes.com, then his browser sends an HTTP request to
cookiemaker.com
.
Is there a way to include the cookie created at (2) in the request sent at (4)?
(Assuming full control of both websites)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
HTTP cookie始终发送到所请求的URL,请求它的来源(
cool-recipes.com
)应与标头的响应如下:如果不存在此标头,您将获得一个错误如下:
您必须将Origin(
cool-recipes.com
)添加到请求的响应标头(cookiemaker.com
)。HTTP cookies are always sent to the url requested, the origin requesting it (
cool-recipes.com
) should have a response with a header as the following:If this header is not present, you will get an error like the following:
You have to add the origin (
cool-recipes.com
) to the site requested response headers (cookiemaker.com
).