Skip to content

Interview question · Application & API Security

Walk through the security attributes of a session cookie: Secure, HttpOnly, SameSite, Domain, Path and the __Host- prefix.

Every attribute answers one question: over which connections, to which scripts, from which sites and to which hosts does this cookie travel? Get those four right and most session theft paths close.

easyNewPreparation tags: Google, Meta, MicrosoftUpdated Nov 2026

What if · the follow-ups in this answer

The answer works through 6 follow-ups like an interviewer would

A web app sets its session cookie without any attributes, and a review flags it.

  1. What does Secure do?
  2. What does HttpOnly do, and not do?
  3. What does SameSite control?
  4. What about Domain and Path?
  5. What does the __Host- prefix add?
  6. Which attributes would you set?

Each rung has a nudge, a model answer, the principle that carries over and the weak answer to avoid. Premium opens every answer and ladder.

UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.