To send a cookie to a client, you add it to the response using addCookie, as in the following statement, where the variable response is an instance of the HttpServletResponse class.
addCookie
response
HttpServletResponse
response.addCookie(cookie);