IE or Chrome can not use localhost, firefox can works.
2013-09-12 16:05
260 查看
因为服务器开启'localhost:9999",使用IE无法登陆,firefox下正常。
遂查看cookie,果然没有写入。
stackoverflow.com:
"ie enable cookies for localhost"
"ie localhost not working"
一般答案都是重置IE,设置hosts文件:127.0.0.1 localhost,都无法解决问题。
正解:
IEs认为domain name都带‘.’,不能为一级域名,所以hosts文件设置"127.0.0.1 localhost.com",可以解决问题 :)
顺便插一句:很多大型网站为了减轻服务器压力,一般把资源文件的cookie domain单独使用一个域名。
ref:http://stackoverflow.com/questions/7346919/chrome-localhost-cookie-not-being-set
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:
Just researched this further; found this answer: Cookies on localhost with explicit domain
遂查看cookie,果然没有写入。
stackoverflow.com:
"ie enable cookies for localhost"
"ie localhost not working"
一般答案都是重置IE,设置hosts文件:127.0.0.1 localhost,都无法解决问题。
正解:
IEs认为domain name都带‘.’,不能为一级域名,所以hosts文件设置"127.0.0.1 localhost.com",可以解决问题 :)
顺便插一句:很多大型网站为了减轻服务器压力,一般把资源文件的cookie domain单独使用一个域名。
ref:http://stackoverflow.com/questions/7346919/chrome-localhost-cookie-not-being-set
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
Just researched this further; found this answer: Cookies on localhost with explicit domain
相关文章推荐
- Jade报错:Invalid indentation,you can use tabs or spaces but not both问题
- Jade报错:Invalid indentation,you can use tabs or spaces but not both问题
- $.ajax not working in chrome but is working in firefox and IE
- javascript 加入收藏夹 ,兼容IE firefox chrome ,解决 window.sidebar.addPanel is not a function
- javascript 加入收藏夹 ,兼容IE firefox chrome ,解决 window.sidebar.addPanel is not a function
- [转]JS根据useAgent来判断edge, ie, firefox, chrome, opera, safari 等浏览器的类型及版本
- Jade报错:Invalid indentation,you can use tabs or spaces but not both
- [乐意黎原创] JS根据浏览器的useAgent来判断edge, ie, firefox, chrome, opera, safari 等浏览器的类型
- firefox 下 'innerText' works in IE, but not in Firefox
- Why is the window.close() works in IE browser but not FireFox? "Warning: Scripts may not close windo
- localhost not wroking in chrome and firefox
- Chrome firefox ie等浏览器空格 宽度不一样怎么办
- MS sqlserver数据库恢复出错 database is in use can not be restored
- 纯CSS调整select选择框高度,兼容IE/Firefox/Opera/Safair/Chrome
- selenium webdriver 启动三大浏览器Firefox,Chrome,IE
- JS控制图片翻转代码,兼容firefox,ie,chrome等浏览器
- Chrome逐渐蚕食IE和Firefox 浏览器市场份额
- Chrome firefox ie等浏览器空格 宽度不一样
- AjaxFileUploader上传插件 兼容性好 Ie Chrome Firefox
- About Derby "ERROR 42X51: The class '***' does not exist or is inaccessible. This can hap pen if the class is not public."