慕森卡
//修改Cookie案例: protected void Button3_Click(object sender, EventArgs e) { //获取客户端的Cookie对象 HttpCookie cok = Request.Cookies["MyCook"]; if (cok != null) { //修改Cookie的两种方法 cok.Values["userid"] = "alter-value"; cok.Values.Set("userid", "alter-value"); //往Cookie里加入新的内容 cok.Values.Set("newid", "newValue"); Response.AppendCookie(cok); } }