【.NET】ajax无法删除cookies解决方法

  给cookies加个AddDay(-1),就能去掉了,试过没问题。代码如下:

        public string LoginOut()
        {
         HttpContext.Current.Response.Cookies.Remove("my");//用这句cookies还在。
            HttpContext.Current.Response.Cookies["my"].Expires = DateTime.Now.AddDays(-1);
            return "{\"msg\":\"ok\"}";
        }        

 

posted on 2018-04-04 14:13  BigOldMouse  阅读(510)  评论(0)    收藏  举报