且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么会User.IsInRole返回true,但不AuthorizeAttribute?

更新时间:2023-02-13 17:15:45

它可以,如果你存储永久性Cookie您的窗体身份验证cookie造成的。在这种情况下IsInRole可以检查对cookie的未经核实的最新登录。

It could be caused if you are storing persistent cookies for your forms authentication cookie. In that scenario IsInRole may check against the cookie without verifying up to date login.