How can I set a cookie in JSP?-
response. setHeader(”Set-Cookie”, “cookie string”); To give the response-object to a bean, write a method setResponse (HttpServletResponse response) – to the bean, and in jsp-file:<% bean. setResponse (response); %> To set a cookie in JSP (JavaServer Pages), you can use the following syntax and code: jsp <%@ page import=”javax.servlet.http.Cookie” %> <% Cookie myCookie = new Cookie(“cookieName”, … Read more