//设置cookie Response.Cookies["loginPage"].Value = "login.aspx"; //命名并给值 Response.Cookies["loginPage"].Expires = DateTime.MaxValue; //时间为最大 //读取cookie string logout = Request.Cookies["loginPage"].Value.ToString(); //清除cookie Response.Cookies["loginPage"].Expires = DateTime.Now.AddDays(-1); //相当于清除