Cookies
For: a developer who writes the cookie text of a privacy page, or checks why a browser drops a cookie.
What it does: this page lists the seven cookies of core. Each is Secure. Six are HttpOnly and hold no data but tokens. The last method cookie is readable by page scripts and holds the name of a sign-in method.
Before you start
Section titled “Before you start”- Read Run the app on another origin for the choice of
SameSite.
The cookies
Section titled “The cookies”| Name | Path | SameSite | Life | Set by |
|---|---|---|---|---|
__Host-tempo_session |
/ |
cookie.sameSite, Lax by default |
session.ttlDays, at most session.absoluteDays |
Every sign-in in a browser |
__Secure-tempo_session_oauth |
<basePath>/social, or the path of the provider’s redirectURI; <basePath>/sso for an SSO sign-in |
None |
10 minutes | The social start and the SSO start |
tempo_totp_trust |
<basePath>/ |
cookie.sameSite |
totp.trustDays |
A second factor verify with trustDevice |
__Host-tempo_session_actor |
/ |
cookie.sameSite, Lax by default |
operator.impersonation.ttlMinutes |
The start of an impersonation |
__Host-tempo_last_method |
/ |
Lax |
lastMethod.days, 30 by default |
A browser sign-in while lastMethod is on |
__Host-tempo_sessions |
/ |
cookie.sameSite, Lax by default |
session.ttlDays, at most session.absoluteDays |
A browser sign-in of another user while multiSession is on |
__Host-tempo_signup |
/ |
Lax |
magicLink.ttlMinutes, or password.verifyCode.ttlMinutes with the code |
A password sign-up, and a resend that carries it |
The __Host- prefix makes a browser refuse the session cookie unless it is Secure, has Path=/, and has no Domain. A host on a sibling subdomain cannot set it. The names keep the old product name tempo-auth for compatibility.
cookieNamerenames the session cookie. The binding cookie is that name with no__Host-or__Secure-prefix, plus__Secure-in front and_oauthat the end.- The old session cookie
tempo_session: core reads it no more since 0.2.0. Version 0.1 read it and moved it to__Host-tempo_session. A browser that holds only the old cookie signs in again. Core still refuses the old name for each other cookie of core. - The Better Auth shim uses the default name, and it reads the old cookie no more. The Expo storage key keeps the name
<storagePrefix>_tempo_session. totp.trustCookieNamerenames the trust cookie.lastMethod.cookieNamerenames the last method cookie. Core refuses a name of another cookie of core.- The bag cookie of multi-session is the session cookie name with
sat the end, socookieNamerenames it too. It holds the otherts_tokens of the browser, joined by., at mostmultiSession.maxminus one. It has the attributes of the session cookie. Core reads it only on the multi-session routes and at a browser sign-in, never as the credential of a request.POST /sign-outends each of its sessions and clears it. - The actor cookie is the session cookie name with
_actorat the end, socookieNamerenames it too. During an impersonation it holds the operator’s ownts_token, and the session cookie holds the token of the impersonation session. The stop clears it and puts the operator’s token back in the session cookie. - A sign-out clears the cookie. After a reset or a claim, the next
GET /sessionclears it.
Deploy note
Section titled “Deploy note”The move of the old cookie tempo_session ended with 0.2.0.
- A browser that called no core route while the app ran 0.1 holds only
tempo_session. With 0.2.0 that browser is signed out, and the person signs in again. The session row of the old cookie stays until it expires, or until the person ends it in the session list. - Core sets every cookie with
Secure, whatever its name. A browser keeps noSecurecookie that a plain http page sets, except onlocalhost. So a staging or LAN host on plain http keeps no session. The__Host-prefix adds no new failure there.cookieNamedoes not change this: core accepts any name, and setsSecureon each. Serve that host over https. - A social sign-in that is open during the deploy fails once with
invalid_token. Core no longer reads the old binding cookietempo_session_oauth, and the binding cookie lives 10 minutes. Start the sign-in again.
The rules
Section titled “The rules”- The session cookie holds a
ts_token. The bag cookie holdsts_tokens in clear, as the session cookie does, and a token of it signs no request in. The binding cookie holds the binding token of one social flow. The trust cookie holds atd_token. The actor cookie holds ats_token. - The sign-up proof cookie holds the
sp_proof of one password sign-up. Its name is fixed, and core refuses it ascookieNameand aslastMethod.cookieName. A confirm that carries it keeps the password of its sign-up. Any other confirm deletes that password. A confirm clears it. For an app on another site, it is a third-party cookie, and many browsers drop it. See the claim rule. - The last method cookie holds one value of a closed set, such as
passwordorsocial:google. It is notHttpOnly, because the sign-in page reads it to show the method of the last sign-in first. It signs no one in and names no account. Core never reads it. A bearer client gets no last method cookie. - A provider’s
redirectURImoves its callback to that path. The binding cookie then has that path, so the browser sends it to the callback. - With a
baseURLlist, no cookie has aDomain, so each host keeps its own cookies. The start sends the callback on its own host, and the sign-in ends where it started. - After a sliding refresh, an app route that calls
auth.sessionmust sendauth.sessionCookie(request, resolved). Otherwise the browser drops the cookie at its oldMax-Age. - A reader that cannot set a cookie, such as a server render, calls
auth.session(request, { refresh: false }). That read does not slide the expiry and writes nothing, so the browser’s ownGET /auth/sessionstill gets the renewed cookie. - The binding cookie is
SameSite=None, because Apple posts its callback from its own site, and a browser sends noLaxcookie on that post. - One binding cookie lives in each browser. A second social start replaces it, and the first flow then answers
invalid_token. - The session cookie is a
__Host-cookie. The trust cookie is a plain host cookie on the auth path. A host on a sibling subdomain can set a cookie of that name for the parent domain. - A native app passes
credentials: "omit". Core reads the cookie before the bearer header, so a stray cookie replaces the bearer session.