Last post Nov 14, 2008 11:35 AM by Erwin21
Nov 14, 2008 10:25 AM|fcampanini|LINK
i have implemented within my application a custom HTTPModule in order to log in a text file the requests. In order to make the logging effective i do need to put also per each entry the content.session.sessionId value but the session object is null in the
begin as well as the end session. I manage the have the value in the
AcquireRequestState Event but ONLY for the aspx page request. For all the requests (such as images) session is null.
This is the event handler
logString += context.Request.FilePath;
Can anyone help me? How can i get the session object each request?
Nov 14, 2008 11:35 AM|Erwin21|LINK
The way to get access to session state in an HttpModule is to implement the placeholder interface IRequireSessionState or IReadOnlySessionState.