title: how to append a cookie for shopping cart details in asp.net in c#
body: <p>here i want to append the product id of new product in the cookie name cart so can anyone help me with it</p>
  
  <pre><code>protected void lnkAddToCart_Click(object sender, EventArgs e)
  {
  
      HttpCookie CartCookie=Request.Cookies["cart"];
      if (CartCookie != null)
      {
          string str = CartCookie.ToString();
          str= str + ";"+ _ProductID.ToString();
          Response.Cookies["cart"].Value = str;
  
      }
      else
      {
           CartCookie = new HttpCookie("cart");
         CartCookie["Cart"] = _ProductID.ToString();
         CartCookie.Expires = DateTime.Now.AddYears(1);
         Response.Cookies.Add(CartCookie);
      }
  }
  </code></pre>