I'm trying to use custom output caching based on a Session variable in Global.GetVaryByCustomString. The problem arises when the Session times out and the user requests a page. I check a cookie and attempt to reset the Session variable if the Session is not set (a default value is set if the data in the cookie is bad or non-existant).
My problems is that I need to run this check/reset code before GetVaryByCustomString is called, but it has to be called after the Session object has been loaded. It needs to run on every request in the application, but not every page is going to be cached. Is there an event or function in HttpApplication that gets called at this time?
Going from lists like this, it looks like caching gets handled at ResolveRequestCache, which runs just before AcquireRequestState, which loads Session. Is what I'm attempting to do not possible?
My problems is that I need to run this check/reset code before GetVaryByCustomString is called, but it has to be called after the Session object has been loaded. It needs to run on every request in the application, but not every page is going to be cached. Is there an event or function in HttpApplication that gets called at this time?
Going from lists like this, it looks like caching gets handled at ResolveRequestCache, which runs just before AcquireRequestState, which loads Session. Is what I'm attempting to do not possible?