pealdevDOCS
Back to peal.dev

AUTH STARTER · MULTI-SESSION

Multi-session

Let one user be logged in to multiple accounts at once and switch between them. Useful for tools used by power users.

Multi-session is a quality-of-life feature for users who juggle several accounts in the same product — agencies, freelancers, devs with personal + work accounts. They sign in once per account; switching is instant.

Turn it on

TypeScript
// src/auth.config.ts
plugins: {
  multiSession: { enabled: true },
},

Client API

TypeScript
// List all active sessions for this browser
const sessions = await authClient.multiSession.listSessions();

// Switch to a different one
await authClient.multiSession.setActive({ sessionId });

// Sign out a single session
await authClient.multiSession.revoke({ sessionId });

How it stays separate from regular sign-out

Regular signOut clears the active session. Multi-session keeps the other sessions in cookies and rotates which one is active. Sign-out only clears the current one — others stay logged in. Worth understanding before exposing it in your UI.

Cookie size grows with sessions

Each active session adds a cookie. Browsers cap per-domain cookies (~4KB total). 3-4 accounts is fine. 10+ and you might hit limits. If you support power users, cap it in your UI.