How does the HttpOnly attribute enhance the security of a cookie?
- Allows the cookie to be modified by client-side scripts
- Enables the cookie to be accessed by JavaScript
- Prevents client-side scripts from accessing the cookie
- Restricts the cookie to HTTP connections
The HttpOnly attribute enhances cookie security by preventing client-side scripts from accessing the cookie. This helps mitigate the risk of cross-site scripting (XSS) attacks that aim to steal sensitive information from cookies.
Loading...
Related Quiz
- The __________ method is used to set an HTTP status code without a message.
- How can stale or broken database connections in the pool be handled effectively?
- What must be done to ensure the safe and correct download of files with different character encodings?
- In the context of servlets, what is a key difference between HTTP and WebSocket protocols?
- Consider a scenario where a request needs to be authenticated and then logged. How should the filters be arranged in the filter chain?