子域名间共享的cookie怎么都删不掉
二级域名间共享的cookie怎么都删不掉,也试过用这个函数.protected void RemoveCookie(string cookieName)
{
HttpCookie Cookie = HttpContext.Current.Request.Cookies[cookieName];
//Cookie.Domain = "xxx.com";
if (Cookie != null)
{
Cookie.Expires = DateTime.Now;
HttpContext.Current.Request.Cookies.Remove(cookieName);
}
Cookie = HttpContext.Current.Response.Cookies[cookieName];
if (Cookie != null)
{
Cookie.Expires = DateTime.Now;
HttpContext.Current.Response.Cookies.Remove(cookieName);
}
}
Request.Cookies["CookieName"] != null(一直成立,并且有内容)
帮我看看.你们是怎么删除的。 --------------------编程问答-------------------- 你试试:HttpContext.Current.Request.Cookies[cookieName]=null; --------------------编程问答-------------------- 直接赋一个空值,Cookie在客户端,服务器是无法移除的 --------------------编程问答-------------------- HttpContext.Current.Request.Cookies[cookieName]=null;
会报错.
补充:.NET技术 , ASP.NET