0
如何在我的自定義授權過濾器中使用Session["userName"]
?在自定義授權過濾器中訪問會話
void IAuthorizationFilter.OnAuthorization(AuthorizationContext filterContext)
{
string userName = Session["userName"]; // Shows error "The name 'Session' does not exist in the current context
base.OnAuthorization(filterContext);
}