I have an IHTTPModule with an event handler for AuthorizeRequest. I would like to access the Session object but it is not yet initialized. Which event should I subscribe to in order to have the session object available as early as possible in the pipeline?
By default, ASP.NET will store session information in memory inside of the worker process (InProc), typically w3wp.exe . There are other modes for storing session, such as Out of Proc and a SQL Server.
Session state is an ASP.NET Core scenario for storage of user data while the user browses a web app. Session state uses a store maintained by the app to persist data across requests from a client.
In ASP.NET session is a state that is used to store and retrieve values of a user. It helps to identify requests from the same browser during a time period (session). It is used to store value for the particular time session. By default, ASP.NET session state is enabled for all ASP.NET applications.
You needd HttpApplication.PostAcquireRequestState event - http://msdn.microsoft.com/en-us/library/system.web.httpapplication.postacquirerequeststate.aspx. Also there is a HttpApplication.AcquireRequestState event. Don't forget to check if your handler implements IRequiresSessionState or IReadOnlySessionState, otherwise it will throw an exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With