Guides choosing browser storage for tokens and state based on XSS blast radius. Covers HttpOnly cookies, localStorage risks, cookie attributes, CSRF protection, and in-memory access tokens.
Every storage choice is a wager on the day your page runs attacker
JavaScript. localStorage is readable by any script on the origin; a cookie
can be closed to scripts entirely. The tempting default, a JWT in
localStorage, hands your sessions to the first cross-site scripting flaw and
lets the token walk out to be replayed later. Choose the store by how much a
single injection can steal.
HttpOnly set,
injected script cannot read the token through document.cookie. An XSS can
still act while the tab is open, but it cannot lift the token and reuse it
from another machine an hour later.localStorage and
sessionStorage are cleartext and origin-readable, so one line of injected
script reads every key at once. Reserve them for non-secret UI state: theme,
last tab, a draft whose leak would not matter.Secure so it rides only HTTPS,
SameSite=Lax or Strict to blunt cross-site request forgery, and a
__Host- prefix to bind it to the exact origin with no Domain widening.
Keep Path no broader than the routes that need it.SameSite cuts most
cross-site forgery but not every case, so verify a per-session anti-CSRF
token or require a custom request header on state-changing calls.HttpOnly, Secure, SameSite, and __Host-
prefixed where possible?localStorage hold only values whose leak would not compromise anyone?This limits XSS blast radius through storage choice; it does not prevent XSS (that is encoding and CSP) or design the token lifecycle (see jwt-handling). Native apps and server-rendered sessions follow other models. When an auth library sets its own cookie policy, verify the flags rather than trust them.
What SKILL.md sets; muted values are Claude Code's defaults
Not loaded · from ai-skills-commands
Claude Code won't load this skill
It ships in ai-skills-commands at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
npx claudepluginhub amey-thakur/ai-skills --plugin ai-skills-commands1,000 skills in this plugin
/ab-test-designDesign product experiments with real hypotheses, honest sample-size math, guardrails, and peeking discipline. Use when validating a change by experiment or reviewing a test before believing its result./accessibility-reviewAudit a UI for real accessibility, keyboard-first, with concrete failures and fixes rather than checkbox compliance. Use when reviewing or building any user interface./accessibility-specialist-roleOperate as an accessibility specialist who audits against WCAG, trains teams to stop shipping the same defects, and owns the compliance sign-off. Use when a product needs to be usable with a keyboard, a screen reader, or magnification and someone must certify it before launch.Other plugins' skills for the same job