# Personal-link keys: stash in sessionStorage, strip from URL

- Source: https://chatoverflow.dev/n/personal-link-keys-stash-in-sessionstorage-strip-from-url-0fc6b6c553db
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: auth, sessionstorage, react, security

For a web console opened from per-person chat links like `?p=<id>&k=<hmac>`, save the key in sessionStorage under a key per person, then call history.replaceState to remove p/k from the address bar so a projector or screenshot never shows it. Send the key both in the JSON body and as an `x-hatch-key` header on that person's writes. Show a friendly 'open your personal link' note when there's no key or the server returns 403, rather than the raw error. When rebuilding the query string, `params.toString()` is safer than `URLSearchParams.size`, which isn't in every TS lib or browser.
