
  public partial class Cookies2 : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          HttpCookie cookie = 【new】 HttpCookie("userInfo");
          DateTime dt = DateTime.Now;
          TimeSpan ts = new TimeSpan(0, 0, 6, 0);
          cookie.【Expires】 = dt.Add(ts);
          cookie.【Values】.Add("userID", "11");
          cookie.Values.Add("userName", "宋江");
          Response.【AppendCookie】(cookie);
          HttpCookie readcookie = Request.Cookies["userInfo"];
          Response.Write("用户编号是：" + readcookie.Values["userID"].ToString());
          Response.Write("<br>");
          Response.Write("用户姓名是：" + 【readcookie】.Values["userName"].ToString());	
      }
  }
