MVC .NET4 IE10下FormsAuthentication.SetAuthCookie无效的问题
来源:互联网 发布:淘宝好评50字以上 编辑:程序博客网 时间:2024/05/01 23:04
MVC .NET4 IE10下FormsAuthentication.SetAuthCookie无效的问题
最初的问题是网站在IE10下不兼容,使用兼容性代码:<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10">
让IE强制使用兼容模式,但是这种情况在有的电脑上没有管理员权限的时候是无效的,
即用IE打开了使用上面这段代码的页面后,按F12,
IE的模式还是IE模式,不是想要的IE10兼容模式。
在有管理员权限的电脑上,变成了IE10兼容模式,问题解决。
另外FormsAuthentication.SetAuthCookie无效的问题,在IE10兼容模式下OK,在IE10模式下无反应。
简单的解决方法是,在网站根目录,新增一个浏览器定义文件(browser definition file) 步骤如下: 1.添加一个"App_Browsers"文件夹 2.添加一个"*.browser"后缀的文件,如IE10.browser. 3.添加文件内容如下: <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>
FormsAuthentication.SetAuthCookie无效的问题得到解决,页面是IE10 模式。
当然还可以参考MS的文章:
在 IIS 上实现 META 切换
Microsoft IIS 能够定义自定义 HTTP 响应标头以便所有页面自动以 EmulateIE7 模式呈现http://msdn.microsoft.com/zh-cn/library/cc817572.aspx
0 0
- MVC .NET4 IE10下FormsAuthentication.SetAuthCookie无效的问题
- MVC .NET4 IE10下FormsAuthentication.SetAuthCookie无效的问题
- MVC .NET的FormsAuthentication.SetAuthCookie在IE10中无效的问题
- FormsAuthentication.SetAuthCookie函数使用无效
- FormsAuthentication.SetAuthCookie函数使用无效
- FormsAuthentication.SetAuthCookie
- FormsAuthentication.SetAuthCookie
- FormsAuthentication.SetAuthCookie
- FormsAuthentication.SetAuthCookie
- 修复Net4.0在IE11下doPostBack无效的问题
- 【转】FormsAuthentication.SetAuthCookie
- FormsAuthentication.SetAuthCookie Method
- FormsAuthentication.SignOut(); FormsAuthentication.SetAuthCookie(u.UserName, false);
- FormsAuthentication.SetAuthCookie 方法 (String, Boolean)
- 用 FormsAuthentication.SetAuthCookie 做权限验证
- 在.net 4.5下FormsAuthentication.HashPasswordForStoringInConfigFile过时的问题
- 在WIN7下安装IE10的问题
- 解决.Net4.0的浏览器兼容性问题,特别是IE10
- Berkeley DB基础教程
- 项目管理包含的内容
- 编程/软件开发语录
- Android 源码分享网站
- 64位电脑上安装MySQL进行MFC开发的相关问题
- MVC .NET4 IE10下FormsAuthentication.SetAuthCookie无效的问题
- 电子商务
- CSDN博客频道支持Windows Live Writer离线写博客 – test by Windows Live Writer
- WIP jobs available to MRP
- 线程的监听 广播接收
- 总线设备驱动
- APPIUM+JAVA自动化测试
- jQuery自动给表单赋值
- jdk与jre的区别