Using the Context.Item Collection

If you try to acces the session object you get an exception at the Application_BeginRequest(…)

You can, however, use Context.Items during Application_BeginRequest. This is an ideal spot to load request specific state to carry through until ASP.NET completes the request. You could, for instance, inspect the incoming request URL and load a preferences object with different settings if the site is balitmore.odetocode.com versus www.odetocode.com. Later, during the Load event of any page, you can inspect the Preferences object in the Items collection to make changes to the UI

protected void Application_BeginRequest(Object sender, EventArgs e) {         string prefix = Request.Url.Host.ToUpper();        if(prefix.StartsWith("BALTIMORE"))         {             Context.Items["PREFERENCES"] = // Load Baltimore preferences         }      else         {             Context.Items["PREFERENCES"] = // Load default preferences         } }

http://odetocode.com/Articles/111.aspx