含有多个值的cookie
//写cookie
HttpCookie mycook = new HttpCookie("pe");
mycook.Values.Add("name","张军");
mycook.Values.Add("age","32");
Response.AppendCookie(mycook);
//读cookie
HttpCookie mycooks = Request.Cookies["pe"];
Response.Write(mycooks["name"]);
Response.Write(mycooks["age"]);
含有单个值的cookie
HttpCookie mycook = new HttpCookie("pe");
mycook.Value="abc";
Response.AppendCookie("mycook"); //写入
HttpCookie mycooks =Request.Cookie["pe"];
Response.Write(mycooks.Value);