RT,在servlet的doget删除cookie时,firefox删除失败,IE和chrome删除成功,现贴上代码,希望各位大虾指教Cookie[] cookies = request.getCookies(); for (Cookie cookie : cookies)
{
cookie.setMaxAge(0); cookie.setPath("/"); response.addCookie(cookie);
}

解决方案 »

  1.   


    private void clearCookie() {
    Cookie[] cs = getCookies();
    if (cs != null && cs.length > 0) {
    for (Cookie c : cs) {
    if (COOKIE_USERNAME.equals(c.getName()) || COOKIE_PASSWORD.equals(c.getName())) {
    c.setMaxAge(0);
     response.addCookie(cookie);
    }
    }
    }
    }你把cookie.setPath("/");这句删掉试试、上面是我们项目里面的,FF和IE均通过
      

  2.   


    ff要连续执行两次才成功,但ie和chrome一次就OK
      

  3.   

    Add this cookie to response. The cookie will be gone once the response is sent back to client.cookie.setMaxAge(0);  
    cookie.setValue("");  
    response.addCookie(cookie);
      

  4.   

    have you added 
    response.setContentType("text/html");remove single signon cookie if it hasn't been validated yet
      

  5.   

    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