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.
Add your answer
Loading...

Leave a comment

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