How will you delete a cookie?
To delete cookie from servlet, get the cookie from the request object and use setMaxAge(0) and then add the cookie to the response object. To delete cookie from JSP, use the following scriptlet: <% Cookie killMyCookie = new Cookie("mycookie", null); killMyCookie.setMaxAge(0); killMyCookie.setPath("/"); response.addCookie(killMyCookie); %>
Posted By:
Name:Rajesh Kr
URL: How will you delete a cookie?