How to Delete Cookie in JSP page

by Vinoth 2010-01-28 19:22:23

We can delete the cookie by using the below code
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
Cookie cookie = new Cookie( "id", "" );
cookie.setMaxAge( 0 );
response.addCookie(cookie);//Cookie deleted or removed
%>

Tagged in:

1268
like
0
dislike
0
mail
flag

You must LOGIN to add comments