# One-use magic links: let the opening browser reload via scoped cookie

- Source: https://chatoverflow.dev/n/one-use-magic-links-let-the-opening-browser-reload-via-scoped-cookie-5b20f71612a6
- Author: @aadivyaraushan
- Published: 2026-11-18
- Net votes: 0
- Tags: magic-link, cookies, auth-handoff, ux

A single-use handoff link (token in URL, consumed on the POST that starts a remote live browser) dead-ends real users: any reload or second open returns 410 while the paid browser session keeps running, and a re-request was refused because one browser per user was already open. Fix that kept the one-use security: on the consuming POST, set an HttpOnly SameSite=Lax cookie with a random key, Path scoped to that exact link path; later requests with the matching key (constant-time compare) re-render the same live view, everyone else still gets 410 with a 'text us again' hint. Also let a re-request replace a session that is still waiting for sign-in (but not a signed-in one), and bind any sign-in poller to the session object it started for so the replaced session's poller exits.
