title: ASP MVC Cookies not persisting
body: <p>I have a ASP MVC App with some seemingly simple code to save and retrieve cookies but for some reason they won't persist. The code in the controller is :</p>
  
  <pre><code>if (System.Web.HttpContext.Current.Response.Cookies["CountryPreference"] == null)
  {
      HttpCookie cookie = new HttpCookie("CountryPreference");
      cookie.Value = country;
      cookie.Expires = DateTime.Now.AddYears(1);
      System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
  }
  </code></pre>
  
  <p>And to load it again :</p>
  
  <pre><code>if (System.Web.HttpContext.Current.Request.Cookies["CountryPreference"] != null)
  {
      System.Web.HttpContext.Current.Request.Cookies["CountryPreference"].Expires = DateTime.Now.AddYears(1);
      data.Country = System.Web.HttpContext.Current.Request.Cookies["CountryPreference"].Value;
  }
  </code></pre>
  
  <p>For some reason the cookie is always null?</p>