0

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

smartcaveman
  • 41,281
  • 29
  • 127
  • 212

1 Answers1

1

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().

Julien Lebosquain
  • 40,639
  • 8
  • 105
  • 117
  • That was actually a typo. The line in the code said Guid.NewGuid(). I rewrote it wrong in the post, but thank you I fixed it. – smartcaveman Nov 03 '10 at 18:42