How to delete a cookie in a JSP page?
Answered
How to delete a cookie in a JSP page?
Best answer
Cookie can be deleted by setting setMaxAge(0) on the cookie object. A cookie, democookie, can be deleted using the following scriptlet:
<% Cookie delCookie = new Cookie("democookie", null); delCookie.setMaxAge(0); delCookie.setPath("/"); response.addCookie(delCookie); %>