title: Not able to set cookie from action
body: <p>I have <strong>ASP.NET MVC</strong> application hosted along with <strong>ASP.NET WebApi</strong> application at <code>localhost</code> and <code>localhost/api</code> and I wan't to set a cookie when one action of <strong>ASP.NET WebApi</strong> called.</p>
  
  <p>I tried to set my cookie like that:</p>
  
  <pre><code>response.Headers.AddCookies(new[]
                                          {
                                              new CookieHeaderValue("test", "asd")
                                              {
                                                  Expires = DateTime.Now.AddDays(1),
                                                  Domain = Request.RequestUri.Host,
                                                  Path = "/",
                                                  HttpOnly = false
                                              }
                                          });
  </code></pre>
  
  <p>I got that in response headers:</p>
  
  <pre><code>Set-Cookie:test=asd; expires=Thu, 30 Oct 2014 09:53:35 GMT; domain=localhost; path=/
  </code></pre>
  
  <p>But that cookie is not creating for some reason.</p>
  
  <p>Just for testing purposes I tried to set cookie from <strong>ASP.NET MVC</strong> application like that:</p>
  
  <pre><code>HttpContext.Response.Cookies.Add(new HttpCookie("test", "asd")
              {
                  Expires = DateTime.Now.AddDays(1),
                  Domain = HttpContext.Request.Url.Host,
                  Path = "/",
                  HttpOnly = false
              });
  </code></pre>
  
  <p>Response headers contain:</p>
  
  <pre><code>Set-Cookie:test=asd; domain=localhost; expires=Thu, 30-Oct-2014 09:56:08 GMT; path=/
  </code></pre>
  
  <p>But still I can't see that cookie. What I am doing wrong how it could be so these headers are ignored? However, other cookies work fine (e.g. .ASPXAUTH).</p>