How can a cookie is deleted with JSP?



How can a cookie is deleted with JSP?..

Answer / 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

More JSP Interview Questions

How can automatic creation of session be prevented in a jsp page?

0 Answers  


Is jsp static or dynamic?

0 Answers  


Which categories can be divided jstl tags, give examples.

0 Answers  


What is jsp action tags?

0 Answers  


Can you override jspinit() method? If yes, in which cases?

0 Answers  






Explain lifecycle methods.

0 Answers  


Can u Override any of the lifecycle methods of JSP?

1 Answers  


What are the two kinds of comments in jsp and what's the difference between them ?

0 Answers  


Plz any body tell me why use jsp over servlet.what is the benefit of jsp over servlet?

4 Answers   Future Generali, HCL,


What is jsessionid?

0 Answers  


What is the jsp:setproperty action?

0 Answers  


How to print java variable in jsp?

0 Answers  


Categories