当前位置: 代码迷 >> J2EE >> servlet 剔除cookie失败
  详细解决方案

servlet 剔除cookie失败

热度:26   发布时间:2016-04-22 00:34:32.0
servlet 删除cookie失败
RT,在servlet的doget删除cookie时,firefox删除失败,IE和chrome删除成功,现贴上代码,希望各位大虾指教
Java code
Cookie[] cookies = request.getCookies();        for (Cookie cookie : cookies)        {            cookie.setMaxAge(0);            cookie.setPath("/");            response.addCookie(cookie);        }


------解决方案--------------------
if all other parts of code are correct, i think the reason could be the local setting of your firefox.

please let me known, if you find the solusion. thanks
  相关解决方案