HttpContext.Current.Session is null in OnPostAuthe

2020-05-01 08:59发布

问题:

This is a n00b question, perhaps you can help.

When I'm in the Application_OnPostAuthenticateRequest event, I am unable to look into the Session since HttpContext.Current.Session is null. Is there a reason that this is null, and is there a way I can access the Session during this event?

Is there an alternative event that allows me to get the authenticated user in addition to the session state?

Thanks! Brett

回答1:

The Session won't be available before the PostAcquireRequestState event is raised.