可能是重复问题:
http.context.user和thread.currentprincipal之间的区别以及何时使用它们的区别?
在ASP.NET应用程序中,这两者有什么区别?
我知道HttpContext.User.Identity
是在用户通过FormsAuthentication
进行身份验证时设置的。但是Thread.CurrentPrincipal.Identity
是在什么时候设置的?
它们始终保持相同的值吗?
对于其他无法访问HttpContext
的应用程序层,这是否仍然成立?
Thread.CurrentPrincipal
仍然可以在mode="forms"
下工作... - bevacqua