CS FundamentalsHardGATE CS · Product company CS fundamentals

Which cookie attribute stops JavaScript running in the page from reading the cookie through document.cookie?

  1. A. HttpOnly
  2. B. Secure
  3. C. SameSite=Strict
  4. D. Path=/

Correct answer: A. HttpOnly

HttpOnly hides the cookie from scripts, limiting session theft by XSS. Secure sends it only over HTTPS, SameSite restricts cross-site sending (CSRF defence), and Path limits which URLs receive it.

More Computer Networks questions

Exams that ask this topic