title: Set default language cookie on ASP.Net MVC application
body: <p>I need to implement multilingual asp.nt mvc application and i set current ui thread with httpmodule below:</p>
  
  <pre><code>public class CookieLocalizationModule : IHttpModule
  {
      public void Dispose()
      {
      }
  
      public void Init(HttpApplication context)
      {
          context.BeginRequest += new EventHandler(context_BeginRequest);
      }
  
      void context_BeginRequest(object sender, EventArgs e)
      {
          // eat the cookie (if any) and set the culture
          if (HttpContext.Current.Request.Cookies["lang"] != null)
          {
              HttpCookie cookie = HttpContext.Current.Request.Cookies["lang"];
              string lang = cookie.Value;
              var culture = new System.Globalization.CultureInfo(lang == "en" ? "en-US" : "tr-TR");
              Thread.CurrentThread.CurrentCulture = culture;
              Thread.CurrentThread.CurrentUICulture = culture;
          }
      }
  }
  </code></pre>
  
  <p>I set language cookie on Global.asax's Session_Start() method because i need to set different language cookie based on request url host (i have multiple sites in mvc application)</p>
  
  <p>When first launch of application in context_BeginRequest() method cookie value is null, so thread culture is not set properly.</p>
  
  <p>Where should i set default cookie (i need to look at url host) ? </p>