
How remove existing cookie in jsp ?

If you want to remove an existing cookie, you can use the method setMaxAge() of that cookie object to set its timeout to zero.Example
<%@page import="javax.servlet.http.Cookie"%>
<%
Cookie[] cookielist = request.getCookies();
if (cookielist!= null) {
for (int i = 0; i < cookielist.length; i++) {
cookielist[i].setMaxAge(0);
out.println(" cookie is removed");
}
}
%>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.