Study. uk . com
  1. Home
  2. All questions
  3. Question 286

CompTIA Security+ study material · question 286 of 611

Which two cookie attributes protect a session identifier, and what does each achieve? Choose two.

  1. Domain, so the cookie is scoped to one host
  2. Max-Age, so the cookie expires with the session
  3. HttpOnly, so page scripts cannot read it
  4. Secure, so the cookie travels only over TLS
Show the answer

Answer: C. HttpOnly, so page scripts cannot read it
D. Secure, so the cookie travels only over TLS

Secure prevents plaintext transmission and HttpOnly limits what stored cross-site scripting can steal.

Source: OWASP Session Management Cheat Sheet (OWASP) — OWASP Session Management Cheat Sheet › Cookies

Challenge yourself on this topic → Study as cards