Quote from http://msdn.microsoft.com/en-us/library/4wt3wttw.aspx:
One instance of the HttpApplication class is used to process many requests in its lifetime. However, it can process only one request at a time. Thus, member variables can be used to store per-request data.
Why per-request? Maybe per set of requests? Seems that member variables can be used to store data during full lifecycle of HttpApplication. Thus state of HttpApplication at the beginning of second (for this HttpApplication) request is equal to the state at the end of first (for this HttpApplication) request.
Why per-request?
It's stating that the members of the HttpApplication object can be used to store per-request data. This doesn't mean that the members are restricted to per-request data. The HttpApplication.Application member holds the members that are global to the entire application, but during the processing of the request, the specific HttpApplication instance may only modify the global information kept in the ApplicationState object with the information in the request currently being processed. If the HttpApplication object had access to multiple requests simultaneously, conceivably it would be able to modify global data with aggregate or select data from any of the requests. As @Sidharth Panwar mentioned, this would create concurrency issues, and it would also be a nightmare to allow multiple requests to be processed because they would need to be guaranteed to come from the same user (for security/memory reasons) which can't be guaranteed since IIS queues up the next available HttpApplication object whenever a new request is made. It would lead to a single instance potentially handling a bulk of the load (and thus bottle-necking).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With