views:

21

answers:

1

We are getting a lot of hits from Googlebot and BingBot and it appears that none of these requests have an HttpContext.

I originally thought that every http request will get a context which obviously is not the case so I'm trying to understand how does an HttpContext gets constructed, is it part of the negotiation between client and server?

+2  A: 

The client doesn't dictate this in any way, in what context are you checking for HttpContext? Are you sure HttpContext.Current is null? (And you're not looking at HttpContext.Current.Session?)

There are some places in the lifecycle where it is unavailable, but this won't vary from client to client.

If you're curious as to more details, I recommend A low-level Look at the ASP.NET Architecture by Rick Strahl, he gives an overview of where things are created/destroyed in the request lifecycle...this hasn't changed a great deal since it was written.

Nick Craver