How can a cookie is deleted with JSP?

Answer Posted / venkat

<%
Cookie killMyCookie = new Cookie("mycookie", null);
<%-- mycookie is the cookie instance which we have to
delete%>
killMyCookie.setMaxAge(0);
killMyCookie.setPath("/");
response.addCookie(killMyCookie);
%>

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does a servlet communicate with a jsp page?

539


What is Include directive?

543


What is an api with example?

592


mention the three important tags used in the development of jsp bean.

476


What is jsp declaration?

493






How can I implement a thread-safe jsp page? What are the advantages and disadvantages of using it?

506


What is an expression in jsp?

523


Differentiate between and <%@include file=…>.

517


How do we configure init params for jsp?

514


Which two interfaces does the javax servlet jsp package have?

738


Why should we not configure jsp standard tags in web.xml?

512


How does jsp engines instantiate tag handler classes instances?

471


What are the different scopes an object can have in a jsp page?

508


Can we use the exception implicit object in any jsp page?

479


Define Static Block.

518