Manage cookies

Manage cookies in JavaScript — with the four heights of help laid out: do it now, make it easier for the next person to accept, work out the right move when you are stuck, and learn the pattern so it stops coming back.

4prompt heights
Open it in the interactive atlas →

The four heights

The same task, four distances: today's deadline, the next reviewer, the stuck moment, the pattern.

Execute — do the immediate task

+
Set a cookie named sessionId with value from sessionIdVar that expires in seven days, is flagged…
Set a cookie named sessionId with value from sessionIdVar that expires in seven days, is flagged HttpOnly and Secure, and set SameSite to Lax. Also update the cookie store so subsequent requests during this session see the new value. Ensure you do not overwrite an existing persistent preference cookie named userPrefs.

Improve — make it easier to accept

+
Before I deploy this cookie change, make it easy for the privacy reviewer to approve. Show which…
Before I deploy this cookie change, make it easy for the privacy reviewer to approve. Show which cookies will be created or updated, their expirations, security flags, and whether any conflict exists with cookies already set: particularly userPrefs and analytics_id. Highlight any cookie that is not HttpOnly or Secure and explain the privacy risk in one sentence.

Decide — diagnose the stuck moment

+
Several users say they get logged out mid-session. I set sessionId as a seven-day cookie with…

Users report being logged out unexpectedly

Several users say they get logged out mid-session. I set sessionId as a seven-day cookie with HttpOnly and Secure flags. I do not know if a reverse proxy or missing domain attribute is clearing it, or if browsers reject SameSite settings. What checks should I run now to pinpoint whether cookies are being dropped by server headers, proxy stripping, or browser policy?

Become — change the pattern

+
Across builds I spend hours chasing cookie problems: domain mismatches, environment-specific cookie…

Debugging cookie issues across environments takes hours

Across builds I spend hours chasing cookie problems: domain mismatches, environment-specific cookie policies, and test suites that don't simulate secure contexts. It costs time and causes flaky auth bugs. What concrete change in how I set and test cookies will cut this debugging time and make deployments reliable?

Next to this one

Other programming language work people do in JavaScript.

Every task here came from the work, not from a feature list — which is why the prompts name what you want done and never the button that does it. The tool changes; the work does not.
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.

The rest of the map

Same library, five ways in.