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.
Loading...
Related Quiz
- How is a servlet configured in a web application?
- In a chat application using WebSockets, when a message is sent to a closed connection, what happens and how should it be handled?
- Servlets can be made thread-safe by making shared resources __________.
- Filters can be used to manipulate the __________ and __________ before they reach a servlet or JSP.
- How does 'cache eviction' differ from 'cache invalidation' in caching strategies?