Question

I am a little confused about the HttpApplication events.

I have a SessionService* that is initialized from an HttpModule. The HttpModule subscribes to HttpApplication.BeginRequest.

In the module I create a new SessionService().

The constructor of the SessionService setsSessionService.ServiceId = Guid.NewGuid().

I am using jquery to send two ajax requests from a link being clicked on a webpage. Both of the links return JSON indicating the SessionService.ServiceId, and it is the same.

I don't know why this is happening, but my best guest is I am misunderstanding when the events fire, and that some of them don't fire every httprequest. Thanks for your help.

*the session service has nothing to do with the HttpSessionState object

Was it helpful?

Solution

BeginRequest fires on every request: whether it's Ajax or not, it's still a HTTP request.

Be careful: new Guid() represents an all-zero GUID. You probably wanted to use Guid.NewGuid().

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top