各位大侠,急!!!!(在线等!!)
我这样写了几条数据存在cookie中了,现在我想清空它,可是这些方法都不行啊,应该怎么做啊?
这是存入的://写入COOKIE中
cookie.Values.Add("writer",url);
cookie.Values.Add("LinkColor",Uip);
cookie.Values.Add("checktf","true");
TimeSpan ts =new TimeSpan(365,0,0,0,0);
DateTime time= DateTime.Now;
cookie.Expires = time+ts;
if(Response.Cookies["cookie"]!=null)
{
//Response.Cookies.Remove("cookie");
Response.AppendCookie(cookie);
}
这是清空的:cookie.Expires = DateTime.Now.AddYears(-1);