How to set a cookie in JSP?

Answer Posted / anji87543

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

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Include directive?

547


Explain static method?

555


What is the resourcebundle class in jsp?

491


Which jsp method cannot be overridden?

518


How can I declare methods within my jsp page?

520






What is < jsp:forward> tag for?

542


How to create menu in jsp with example?

480


What is the use of session management?

449


Explain the various scope values for tag.

499


Explain the difference between servlet and jsp?

541


What does .com stand for?

474


What are the elements of jsp?

495


Can we use jsp implicit objects in a method defined in jsp declaration?

514


Can we use javascript with jsp pages?

503


Can I declare a java class in jsp?

497