2013-03-27 55 views
2

我有一个umbraco网站,并且正在为公共站点使用集成Windows身份验证。在IE,Firefox,Safari中都可以正常工作。但是,在goolgle chrome中,用户会一直回到登录页面。有时它可以正常工作,其他则不可以它记录在用户的代码如下:会员信息在Chrome浏览器中不支持Umbraco ASP.NET只有

//some stuff to get the member name from the windows username, then: 
FormsAuthentication.SetAuthCookie(username, true); 

    Member loginMember = Member.GetMemberFromLoginName(username); 
    if (loginMember != null) 
    { 
     Member.AddMemberToCache(loginMember, true, new TimeSpan(0, 20, 0)); 
    } 
    FormsAuthentication.RedirectFromLoginPage(username, true); 

如前所述,该工程确定在任何浏览器Chrome以外的..任何想法?

+0

你有没有可能将chrome设置为不接受cookie或者正在使用其他可能妨碍其他功能的插件? – 2013-03-28 23:27:09

回答

0

您是否在重定向之前检查该成员是否有效?

 
if (Membership.ValidateUser(username, password)) 
{ 
FormsAuthentication.SetAuthCookie(username, true); 
// rest of your code here 
} 

如果这不起作用,则没有看到更多的代码,我觉得没有足够的信息,为什么你被登出正确回答。如果你真的相信它只是Chrome,那么请尝试1)在隐身模式下使用chrome(ctrl + shift + N),以及2)重新安装chrome。插件可能会干扰您的Cookie存储。

最后,如果重新安装Chrome浏览器后问题仍然存在,那么请看看下面的代码:

http://our.umbraco.org/projects/website-utilities/razorlogin

祝你好运,并请让我们知道,如果它的工作原理。