How to set a cookie in JSP?

Answers were Sorted based on User's Feedback



How to set a cookie in JSP?..

Answer / venkat

<%
Cookie mycookie = new Cookie("aName","aValue");
response.addCookie(mycookie);
%>

Is This Answer Correct ?    18 Yes 2 No

How to set a cookie in JSP?..

Answer / anji87543

<%
Cookie mycookie = new Cookie("aName","aValue");
response.addCookie(mycookie);
%>

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More JSP Interview Questions

how can we retrieve the values in jsp by using custom tags

4 Answers   IBM, Wipro,


What jsp lifecycle methods can I override?

0 Answers  


how to pass values to a function fron input tags, and how to display that values in that called function

2 Answers   TCS,


Define Static Block.

0 Answers  


Why is _jspservice () method starting with an '_'?

0 Answers  






What is scriptlet tag?

0 Answers  


What is difference between sendredirect and forward?

0 Answers  


Define Composition.

0 Answers  


Explain the <jsp:param> action?

0 Answers  


What is session getattribute in jsp?

0 Answers  


What are the events in jsp page?

0 Answers  


What program opens a jsp file?

0 Answers  


Categories