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

Explain the difference between forward and sendredirect?

1 Answers  


Can we write java code in jsp?

1 Answers  


What is out println in jsp?

1 Answers  


How can I declare methods within my jsp page?

1 Answers  


Is jsp better than servlet?

1 Answers  


What is a hidden comment?

1 Answers  


How do you delete a cookie within a jsp?

1 Answers  


Can you call jsp from servlet?

1 Answers  


What is the <jsp:include> standard action?

1 Answers  


What is welcome file list?

1 Answers  


Why taglib is used in jsp?

1 Answers  


How do you import the packages in the JSP?

14 Answers   HCL, Hyderabad Central University,


Categories