Chrome 不会在损坏的 https 中为 domain=localhost 创建 cookie [英] Chrome doesn't create cookie for domain=localhost in broken https

查看:33
本文介绍了Chrome 不会在损坏的 https 中为 domain=localhost 创建 cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的本​​地主机上有 https 应用程序.但是本地主机上的认证坏了.

下面是响应头.问题:未创建 MyCookie:

MyCookie=MyValue;Path=/;Domain=localhost;Secure;仅Http

但是对于这个标题.cookie 已创建:

MyCookie=MyValue;Path=/;Secure;仅Http

是否有任何 Chrome 政策不允许为在标头中设置域的损坏的 https 页面创建 cookie?

解决方案

在 localhost 上显式设置域 cookie 不适用于 chrome.

来自这个:><块引用>

您只能为注册控制的域设置域 cookie,即以 .com 结尾的东西,但不是 IP或 Intranet 主机名,例如本地主机

I have application on my localhost in https. But the certification on localhost is broken.

Below, response header. Problem: MyCookie is not created:

MyCookie=MyValue;Path=/;Domain=localhost;Secure; HttpOnly

But for this header. The cookie is created:

MyCookie=MyValue;Path=/;Secure; HttpOnly

Is there any Chrome politics which disallow create cookie for broken https page which set domain in the header?

解决方案

Explicit setting domain cookie on localhost doesn't work for chrome.

From this:

You can only set domain cookies for registry controlled domains, i.e. something ending in .com or so, but not IPs or intranet hostnames like localhost

这篇关于Chrome 不会在损坏的 https 中为 domain=localhost 创建 cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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