如何使用 servlet 从客户端浏览器中删除 cookie?
HttpSession ses=request.getSession(false);
Cookie c[]=request.getCookies();
for (int i=0; i<c.length; i++) //Removing cookie, if present
{
if(c[i].getName().equals("UserID"))
{
System.out.println(c[i].getValue()+" is logging out --- Cookie Set to expire!");
c[i].setMaxAge(0);
response.addCookie(c[i]);
break;
}
}
有没有其他方法可以删除???