![](/img/trans.png)
[英]HttpContext.Current.User.Identity.Name returns DefaultAppPool, why?
[英]@HttpContext.Current.User.Identity.Name returns a different user name
我正在使用托管在 azure 中的 azure 活動目錄身份驗證來處理 web 應用程序。當我嘗試使用“@HttpContext.Current.User.Identity.Name”顯示登錄用戶時,它會按預期顯示用戶 email。 但是當其他用戶同時登錄時,我的 UI 會顯示其他用戶名。 我沒有緩存或使用 static 變量來檢索登錄的用戶信息。 我嘗試使用以下但存在同樣的問題。 關於顯示正確登錄用戶名的問題的任何指示?
在這里簡短回答......讓我知道它是否也適合你。
Sub CloseConn(ByVal sender As Object, ByVal e As EventArgs)
Request.Cookies.Clear()
FormsAuthentication.SignOut()
Session.Clear()
End Sub
這是我的母版頁上的控件:MYMASTER.MASTER
<asp:LoginStatus OnLoggedOut="ClearAllData" ID="LoginStatus1" runat="server" LogoutPageUrl="http://www.mysite1234.domain/" LogoutText="<%$Resources: Glossary, LogoutText%>" LoginText="" LogoutAction="Refresh" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.