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

Can we override jspinit method?

0 Answers  


What is jsp action tags?

0 Answers  


Can we use jsp implicit objects in a method defined in jsp declaration?

0 Answers  


How to retrieve warnings?

0 Answers  


What are jsp el implicit objects and how it’s different from jsp implicit objects?

0 Answers  






Where we use assertion in java programming?

2 Answers  


How can we disable el?

0 Answers  


What is action tag in jsp?

0 Answers  


What is attribute in jsp?

0 Answers  


How many jsp implicit objects are there?

0 Answers  


What is jsp exception?

0 Answers  


How can we retrieve warnings?

0 Answers  


Categories