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

Can we use jstl in html?

462


What is an expression in jsp?

531


Can Static method be Override?

557


How do you comment out in jsp?

564


What are the benefits of pagecontext implicit object?

773






What will happen if iselignored attribute is set as false?

481


What is the use of session management?

456


Which tags are used for bean development?

483


What are jsp lifecycle methods?

535


When does a container initialize multiple jsp / servlet objects?

625


When destroy method of jsp is called?

506


What are advantages of jsp over asp, php, pure servlets and others?

483


What is a scriptlet?

517


What are context initialization parameters?

565


Explain the uses of tag.

535