none
怪异问题cookie删除不掉 RRS feed

  • 问题

  • HttpCookie cookies = Request.Cookies[cookiename];
                    if (cookies != null)
                    {
                        cookies.Expires =DateTime.Today.AddDays(-1);
                        Response.Cookies.Add(cookies);
                        
                    }

    一致以来我就这样删除cookie,但是今天删除不掉,查找了下:

    HttpCookie cookies = Request.Cookies[cookiename];
                    if (cookies != null)
                    {
                        cookies.Expires = DateTime.Today.AddDays(-1);
                        Response.Cookies.Add(cookies);
                        Request.Cookies.Remove(cookiename);
                    }
    但是怎么都删除不掉,删除cookie有哪些原因决定了删除不掉?

    2013年8月5日 9:45

答案