IE10 User-Agent 导致 ASP.Net 不发回 Set-Cookie(IE10 未设置 cookie) [英] IE10 User-Agent causes ASP.Net to not send back Set-Cookie (IE10 not setting cookies)
问题描述
总结
ASP.Net 在使用 IE 10 时不会发回 Set-Cookie
标头.这意味着例如,当使用表单身份验证时,您无法使用 IE10 登录到 ASP.Net 站点.
ASP.Net does not send back a Set-Cookie
header when using IE 10. Meaning that for example you cannot login to an ASP.Net site using IE10 when using Forms Authentication for example.
细节
我们目前正在针对 IE 10 [预览版 2] 测试我们的一个旧版网络应用程序.
We're currently testing one of our legacy web apps against IE 10 [Preview 2].
当尝试使用表单身份验证登录时,如果用户代理是 IE 10 的用户代理,我们不会在响应中收到 Set-Cookie
标头.我们已经尝试使用空白.Net 2 和 .Net 4 站点.
When attempting to login using Forms Authentication, we don't get a Set-Cookie
header in the response if the user-agent is that of IE 10. We've tried this with a blank .Net 2 and .Net 4 site.
因为我们无法/不会相信,我们甚至通过 telnet
手动运行了以下 HTTP 请求 - 在使用了所有常用工具之后 - 并得到了相同的响应.
Because we couldn't/wouldn't believe it, we even ran the follow HTTP request manually through telnet
- after using all usual tools - and got the same response.
GET http://test.ourdomain.co.uk/ HTTP/1.1
Accept: */*
Host: test.ourdomain.co.uk
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)
Content-Length: 0
上述 HTTP 请求在响应中没有返回 Set-Cookie
.然而,如果我们简单地将 User-Agent 更改为 Mozilla/5.0(兼容;MSIE 9.0;Windows NT 6.1;Trident/6.0)
它可以工作!
The above HTTP request returns no Set-Cookie
in the response. Yet if we simply change the User-Agent to Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/6.0)
it works!
其他人能复制这个吗?除了影响非标准 URL 模式的问题之外,我找不到 IE10 cookie 的任何已知问题.
Can anyone else replicate this? I can't find any known issue with IE10 cookies other than an issue that effects non-standard URL patterns.
修补程序
在 devio 发布原始答案后,有一个解决方法,nullptr 已经确认现在有一个修补程序.
After devio posted the original answer, with a workaround, nullptr has confirm that there is now a hotfix for this.
http://support.microsoft.com/kb/2600088
我已将修补程序推广到主要问题,因为它更方便以供将来参考,但请为提到的用户投票.
I've promoted the hotfix to the main question as it's just handier for future reference, but please do up-vote the users mentioned.
推荐答案
在 MS Connect,该行为是公认的错误.
Found this entry on MS Connect, the behavior is a recognized bug.
建议的解决方法(来自条目):
Suggested Workaround (from the entry):
== 解决方法 ==
与此同时,要使其正常工作并避免在将来,我使用一个文件 ~App_BrowsersBrowserFile.browser 和以下:
In the meantime to make it work and to avoid similar issues in the future, I use a file ~App_BrowsersBrowserFile.browser with the following:
<browsers>
<browser refID="Default">
<capabilities><!-- To avoid wrong detections of e.g. IE10 -->
<capability name="cookies" value="true" />
<capability name="ecmascriptversion" value="3.0" />
</capabilities>
</browser>
</browsers>
这篇关于IE10 User-Agent 导致 ASP.Net 不发回 Set-Cookie(IE10 未设置 cookie)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!