title: Server cannot modify cookies after HTTP headers have been sent with search bots
body: <p>I'm not sure what is happening here but sometimes I get an error message "<code>Server cannot modify cookies after HTTP headers have been sent</code>" when trying to set cookies.  From what I can tell it is mostly search bots of some sort.  Do bots have cookies disabled or something?  I can't reproduce it when I disable cookies.  My code below is ran in the controller.  Does it look correct?</p>
  
  <pre><code>                var cookie = new HttpCookie(Config.ApiCookie)
                  {
                      HttpOnly = true,
                      Secure = false,
                      Value = authenticationResponse[SessionKey].ToString()
                  };
  
                  if (HttpContext.Current.Response.Cookies[Config.ApiCookie] != null)
                  {
                      HttpContext.Current.Response.Cookies.Set(cookie);
                  }
                  else
                  {
                      HttpContext.Current.Response.Cookies.Add(cookie);
                  }
  </code></pre>