In servlets, which method is used to add a cookie to the response headers?

  • response.addCookie(Cookie cookie);
  • response.createCookie(Cookie cookie);
  • response.insertCookie(Cookie cookie);
  • response.setCookie(Cookie cookie);
The correct method to add a cookie to the response headers in servlets is response.addCookie(Cookie cookie);.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *