LEARN. PRACTICE. EXPLAIN.
Learning paths & interview practiceP
← Build a security log triage & authorization analyzer
BUILD → VERIFY → EXPLAIN · STEP 5 OF 6

Inspect session cookie security attributes

Verify transport, script-isolation, and cross-site cookie flags.

UNDERSTAND

Bring these concepts with you

BUILD

Your implementation

  1. Implement inspectSessionCookieHeader(setCookieHeader) returning { safe, findings }.
  2. Flag missing HttpOnly, Secure, or SameSite attributes, and catch SameSite=None without Secure.
export function inspectSessionCookieHeader(setCookieHeader) {
  // Audit HttpOnly, Secure, and SameSite cookie attributes.
}
Need a hint?
  • Parse attributes case-insensitively with word boundaries.
  • Remember HttpOnly prevents script reads, not CSRF—SameSite and explicit CSRF tokens solve different threats.

Saved on this device · 0 / 6000 · Do not include passwords or private data.

VERIFY

Acceptance checks

From the folder containing your downloaded files, run:

node checks.mjs ./starter.mjs 5

This runs checks up to this step. Earlier steps must work first. Mark each result only after checking your implementation; the website does not run or grade it.

Record your attempt to enable the checklist and reference comparison.

Compare with the reference

Attempt the step first, then compare decisions and behavior. There can be more than one correct implementation.

EXPLAIN

Your interviewer asks

If a session cookie has HttpOnly and Secure, why could an attacker's website still trigger an authenticated action?

Say your answer aloud, then record the trade-offs and evidence in your notes above.

LOCAL VOICE REHEARSAL

Rehearse your step walkthrough aloud

Target pacing: 02:00 · Stays in this browser only; never uploaded.

00:00/ 02:00
AlifBay Prep