Deleting Cookies in JSP Pages

Q

How do you delete a Cookie within a JSP?

✍: FYICENTER.com

A
Cookie mycook = new Cookie("name","value");   
response.addCookie(mycook);   

Cookie killmycook = new Cookie("mycook","value");   
killmycook.setMaxAge(0);   
killmycook.setPath("/");   
killmycook.addCookie(killmycook);   

2007-04-03, 4698👍, 0💬