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

Explain the jsp implicit objects?

620


How can I use the results of my method? ea: <%! method (int x) { stuff return y; } %> <% out.println(y); %> how can I make this work? "y" is a variable made during the method.

1724


What are the jsp elements?

521


i need the source code for opening a word document in java

1863


Explain the uses of jsp?

618






Is jsp used?

579


What is el?

583


How do I mix jsp and ssi #include? What is the difference between include directive & jsp:include action?

597


Explain the various scope values for tag.

607


What is application scope in jsp?

591


Explain the uses of tag.

621


Which method cannot be overridden in jsp?

589


What information is needed to create a tcp socket?

598


What is c tag in jsp?

560


What are the advantages of jstl?

564