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

What are scripting elements?

0 Answers  


What are the advantages of jstl?

0 Answers  


Which package does jsp api consist of?

0 Answers  


How can I implement a thread-safe jsp page? What are the advantages and disadvantages of using it?

0 Answers  


Which attribute specifies a jsp page that should process any exceptions thrown but not caught in the current page?

0 Answers  






What are JSP scripting elements?

8 Answers  


How session is achieved in JSP?(once user logs out,if he press back button of browser he should not be allowed to same page)

0 Answers  


Is jsp static or dynamic?

0 Answers  


When does a container initialize multiple jsp / servlet objects?

0 Answers  


What is scriptlet, expression and declaration in jsp?

0 Answers  


How can the applets be displayed in the jsp? Explain with an example.

0 Answers  


What is expression language injection?

0 Answers  


Categories