ASP.NET登录/会员 - 如何注销? [英] ASP.NET Login/Membership - How to logout?
问题描述
我现在用的是< ASP:LoginStatus>
控制(连同< ASP:登录>
)
I am using the <asp:LoginStatus>
control (along with <asp:Login>
)
我登录成功为 A 。结果
然后,我退出。结果
如果我再登录为乙,目前用户仍然 A 。结果
(这两个&LT; ASP:LoginName将&GT;
和 HttpContext.Current.User.Identity.Name
都出现的一个)
I login successfully as A.
Then I logout.
If I then login as B, the current user is still A.
(Both <asp:LoginName>
and HttpContext.Current.User.Identity.Name
are showing A)
我要明确的饼干完全注销。
I have to clear the cookies to completely logout.
为什么不.NET登录控件登录我出去正确?任何人有任何想法?
Why doesn't the .NET login control log me out properly? Anyone has any idea?
修改:我很抱歉,大家好!这是一个一把umbraco错误即可。我忘了我是用UmbracoMembershipProvider
EDIT: I apologize everyone! This is an Umbraco bug. I forgot I was using UmbracoMembershipProvider
推荐答案
在注销彻底清除出在用户登录我会用:
On logout to completely clear out the logged in user I would use:
Session.Clear()
Session.Abandon()
FormsAuthentication.SignOut()
FormsAuthentication.RedirectToLoginPage()
这篇关于ASP.NET登录/会员 - 如何注销?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!