How do I set a cookie within a JSP page?
Created May 4, 2012
Govind Seshadri Setting cookies from within a JSP page is similar to the way they are done within servlets. For
example, the following scriptlet sets a cookie "mycookie" at the client:
<% Cookie mycookie = new Cookie("aName","aValue"); response.addCookie(mycookie); %>
Typically, cookies are set at the beginning of a JSP page, as they are sent out as part of the HTTP headers.