InterviewSolution
Setting cookies with JSP involves three steps −
Creating a Cookie object − You call the Cookie constructor with a cookie name and a cookie value, both of which are strings.
Setting the maximum age − You use setMaxAge to specify how long (in seconds) the cookie should be valid.
Sending the Cookie into the HTTP response headers − You use response.addCookie to add cookies in the HTTP response header
Your experience on this site will be improved by allowing cookies. Read Cookie Policy