How can a servlet invalidate a cookie that has been sent to the client?

  • By calling response.expireCookie()
  • By setting the cookie to null
  • By setting the cookie's Max-Age to 0
  • By using request.removeCookie()
A servlet can invalidate a cookie by setting its Max-Age attribute to 0, indicating that the cookie has expired, and the client should discard it.
Add your answer
Loading...

Leave a comment

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