IE 10登录问题

时间:2012-11-29 19:32:35

标签: asp.net authentication asp.net-mvc-2 internet-explorer-10

在win 7和win 8上,我的登录仅停止在IE 10中工作。其余的浏览器表现正常。赢得7的IE 9也正常工作。

这就是我们在网站的mvc部分所拥有的内容。 ajax确认返回到页面,然后重定向到仪表板页面。由于仪表板页面位于登录后面,因此用户将被重定向回登录页面。

public void SignInUser(UserInfo user)
        {
            FormsAuthentication.SignOut();
            SessionService.AbandonSession();
            FormsAuthentication.SetAuthCookie(user.UserId, false);
            //here we put the user in session
            //here we log hit
        }

这就是我们在Kentico CMS方面的经典asp.net。这是一个Web服务请求,执行登录代码,然后确认返回到页面,该页面又重定向到仪表板页面。这里也发生了同样的事情。用户被重定向回登录页面。

FormsAuthentication.SignOut();
                    FormsAuthentication.SetAuthCookie(user.UserId, false);

有没有其他人在他们的网站上看到过这样的行为?

3 个答案:

答案 0 :(得分:5)

此问题有hotfix,使用IE 10时Set-Cookie header is not sent back

这也在Connect上,如果您无法应用此修补程序,则在连接线程中提到了一种解决方法。

答案 1 :(得分:1)

只需安装.net framework 4.5,它就会解决您在IE10 & IE11中遇到的大部分问题。 .net framework 4.5framework 4.0高度兼容,可解决IE9, IE10 and IE11的大部分问题。您不需要将应用程序框架定位到4.5,在构建配置中保留4.0。

答案 2 :(得分:0)

此问题通常是由于Internet Explorer版本的缓存问题引起的。 您只需要在Application_BeginRequest()文件的global.asax中编写以下代码。

protected void Application_BeginRequest()
{
    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
    Response.Cache.SetNoStore();
}