铬本地主机的cookie不被设置 [英] Chrome localhost cookie not being set

查看:205
本文介绍了铬本地主机的cookie不被设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Cookie来存储用户选择的语言的ASP.net应用程序。
一切正常,除非我在本地主机的罚款。
通过127.0.0.1本地主机的更换使得人们重新工作......为什么?

I have an ASP.net application that uses a cookie to store the user selected language. Everything works fine except when I'm on localhost. Replacing localhost by 127.0.0.1 makes it work again... why?

只见打算限制为file://,但我无法真正找到任何提及打算限制到本地主机

I saw intended restrictions to file:// but I can't actually find any reference to intended restriction to localhost.

我真的不能明白的是,为什么ASP.net会议(ASP.NET_SessionId)和ASP.net窗体身份验证Cookie(.FSAUTHSSO)为本地主机域的设置是否正确,但我的饼干都没有......为什么?!

What I can't really understand is why the ASP.net Session (ASP.NET_SessionId) and ASP.net Forms Authentication Cookies (.FSAUTHSSO) are correctly set for the localhost domain but my cookies aren't... why?!

我已经用Google搜索了很多,没有什么作品:

I already googled a lot and nothing works:


  • 设置Chrome的命令行标志--enable-文件饼干[不
    WORK]

  • 该cookie设置为仅Http [没关系]

  • 更改期满会话或一个日期...... [没关系]

  • 更改cookie路径为根(/)或别的[没关系]

那么,是什么关系? :)

So what does matter? :)

为什么可以在ASP.net的cookies设置和我不?有什么区别?

And why can the ASP.net cookies be set and mine don't? What's the difference?

最后一件事刚一提的是,这也发生在IE浏览器,但是,法郎的罚款。

Last thing just to mention that this also happens on IE but works fine on FF.

谢谢!

亚历

推荐答案

Cookies是专为第二级和向下。第一级域名将无法正常工作。相反,你应该使用地址 http://127.0.0.1 (如你所提到的),或者你可以编辑您的主机文件映射到一个不同的URL TLD的地址为127.0.0.1,如:

Cookies are designed for second level and down. First level domains will not work. Instead you should use the address http://127.0.0.1 (as you mentioned) or you could edit your hosts file to map a different URL with a TLD to the address 127.0.0.1 such as:

yoursite.tld   127.0.0.1

就进一步研究这一点;发现了这样的回答:与明确的领域本地主机饼干

这篇关于铬本地主机的cookie不被设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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