成员信息没有在Umbraco ASP中持久化.. NET仅在谷歌浏览器



我有一个umbraco站点,并且正在为公共站点使用集成的windows身份验证。在IE, Firefox, Safari中都可以正常工作。然而,在谷歌浏览器中,用户不断被送回登录页面。有时效果不错,有时不行。下面列出了用户登录的代码:

//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以外的任何浏览器中都可以正常工作。什么好主意吗?

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

<>之前如果会员。ValidateUser(用户名、密码){FormsAuthentication。SetAuthCookie(用户名、真实);//剩下的代码在这里}之前

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

最后,如果重新安装Chrome后问题仍然存在,那么请查看以下代码:

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

祝你好运,请告诉我们它是否有效。

最新更新