title: c# cookies not being written to
body: <p>On my content page I have the code (in page_load):</p>
  
  <pre><code>    if (Master.pageAction == "remove")
      {
          int removeProductID = int.Parse(Request.QueryString["ID"]);
          int removeOptionID = int.Parse(Request.QueryString["optID"]);
          Master.myBasket.removeFromBasket(removeProductID, removeOptionID);
          //Response.Redirect("viewBasket.aspx");
      }
  </code></pre>
  
  <p>The function remove from basket is defined as:</p>
  
  <pre><code>// Removes item from a basket
  public void removeFromBasket(int itemsID, int optionsID)
  {
      Page myPage = (Page)HttpContext.Current.Handler;
  
      this.setCookieString("");
      myPage.Response.Write("done");
  }
  </code></pre>
  
  <p>And it calls:</p>
  
  <pre><code>// Sets cookie date
  public void setCookieString(string cookiesData)
  {
      Page myPage = (Page)HttpContext.Current.Handler;
      HttpCookie basketCookie = new HttpCookie("basket");
      basketCookie["items"] = cookiesData;
      basketCookie.Expires = DateTime.Now.AddDays(7d);
      myPage.Response.Cookies.Add(basketCookie);
  }
  </code></pre>
  
  <p>I use the setcookiestring function on other pages and it works fine, but this function (removing from the basket) isn't setting the cookie!  It is writing "done" to the top of the page, so the functions are executing.</p>
  
  <p>No warnings, no errors, it's just not updating the cookie. </p>