What is the first global.asax event that Session is accessible assuming the context handler is IRequiresSessionState or IReadOnlySessionState?

前端 未结 1 736
挽巷
挽巷 2020-12-11 22:24

My app sometimes calls Server.Transfer in the Application_OnPostAuthenticateRequest event of the global.asax to act as kind of url rewite. When th

相关标签:
1条回答
  • 2020-12-11 22:49

    The PostAuthenticateRequest occurs before the AcquireRequestState and the session state should only be available after this event is raised, so if you need to access session state for the request you need to wait for that event.

    See this page as a reference.

    1. ...
    2. Raise the PostAuthenticateRequest event.
    3. ...
    4. Raise the AcquireRequestState event.
    5. ...
    0 讨论(0)
提交回复
热议问题