Cookies are text files that are downloaded onto a visitor's hard drive to store the visitor's actions in order to better
customize their following visits. We may handle cookies in JSP and I will show you how to do that.
JSP provides an implicit response object which is used to add cookies. To add a cookie to the response, addCookie method is used.
We may store useful information in cookies for later use and this method is perfect for our needs. Java Code: response.addCookie(Cookie