title: unable to get updated cookie value in jquery after ajax call
body: <p>I have made a simple cart example in mvc. 
  what I'm doing is , after clicking on <code>Add to cart</code> span , I'm calling a Controller Action method.</p>
  
  <p>And then updating the cookie value with Total no of item in cart. but it give me initial value of cookie. </p>
  
  <p>This is my Ajax Code to call Controller Action </p>
  
  <pre><code>   $(document).delegate('.addCart','click', function () {
              var getId = parseInt($(this).attr('id').slice(3));
              $.ajax({
                  type: 'GET',
                  contentType: 'application/json; charset=utf-8',
                  url: '/Comments/CartDetailsSetGet',
                  data: { Id: getId },
                  success: function (data) {
                      var count = parseInt(data);
                      if (isNaN(count)){
                          alert(data);
                      }else{
                          var getCookies=  @HttpContext.Current.Request.Cookies["CartCookie"].Value;
                          $('.cartNum').html(getCookies);
                      }
                  },
                  error: function (data) {
                      alert("Error In Adding Item To Cart");
                  }
              });
          });
  </code></pre>
  
  <p>There is <code>span &gt; with class cartNum</code> in which I'm showing Total no of item in cart .</p>
  
  <p><code>addCart</code> is span on which I'm Clicking to Add Item In Cart.</p>
  
  <p>This is my Action Method , which is My default Action </p>
  
  <pre><code>HttpCookie ck = new HttpCookie("CartCookie");
          public ActionResult Index()
          {
              if (Request.Cookies["CartCookie"] == null)
              {
                  ck.Value = "0";
                  Response.SetCookie(ck);
              }
              IList&lt;Comment&gt; commentList = db.Comments.ToList();
              return View(commentList);
          }
  </code></pre>
  
  <p>This Action Which is getting called On Ajax Request.</p>
  
  <pre><code>static List&lt;int?&gt; CartItemsId = new List&lt;int?&gt;();
          public string CartDetailsSetGet(int? Id)
          {
                if (CartItemsId.Contains(Id) != true)
                  {
                      CartItemsId.Add(Id);
                      int getCount = CartItemsId.Count();
                      System.Web.HttpContext.Current.Request.Cookies["CartCookie"].Value = getCount.ToString();
                      ck.Expires = DateTime.Now.AddDays(-1);
                      var d = "";
                      if (System.Web.HttpContext.Current.Request.Cookies["CartCookie"] != null)
                      {
                          d = System.Web.HttpContext.Current.Request.Cookies["CartCookie"].Value;
                      }
                      return d.ToString();
                  }
                  else
                  {
                      return "This Item Is Already In Cart";
                  }            
          }
  </code></pre>
  
  <p>Here in <code>d</code> I'm getting updated cookie value but in Ajax Success , this line giving me Initial value, i.e 0.</p>
  
  <p><code>var getCookies=  @HttpContext.Current.Request.Cookies["CartCookie"].Value;</code></p>