Features

User Session

One visitor session per storefront, known on the server and in the browser. Read the signed-in visitor with getUserSession on the server and useUserSession in components; an installed app such as Shopify brings the login.

Who is signed in

A storefront has one visitor session. An installed app brings the login — a session driver — and Frontend Core gives every part of the storefront the same answer to "who is signed in?": server code, your own apps, the header, analytics. Without a driver, nobody is signed in.

A session has one of three states:

StateMeans
unknownIt cannot be told yet: during the server render, while the browser asks, or when the login provider did not answer. An outage is unknown, never anonymous.
anonymousNobody is signed in.
authenticatedA visitor is signed in. subject names them: id, and email and displayName where the driver knows them.

In components: useUserSession

components/AccountGreeting.vue
<script setup lang="ts">
const { isAuthenticated, subject, pending, login, logout } = useUserSession();
</script>

<template>
  <span v-if="pending">…</span>
  <button v-else-if="isAuthenticated" @click="logout()">Sign out {{ subject?.displayName }}</button>
  <button v-else @click="login()">Sign in</button>
</template>
  • During the server render the status is unknown, so the HTML is the same for every visitor and a cache may keep it. The browser settles the session after hydration.
  • loginHref and accountHref never depend on the visitor, so you can render them on the server. Send a visitor to the login with login() or a plain anchor with rel="nofollow", never with a NuxtLink: the login route writes a cookie, and a router link may prefetch it.
  • logout() signs the visitor out here and at the login provider, then follows the provider's logout page. When the driver has no way to end the provider's session, the visitor is signed out here only and the page reloads. No sign-out control ships with the standard sections; add one with logout() where your storefront needs it.
  • error carries login-failed once after a failed login, resolve-failed when the session could not be read, and logout-failed when a sign-out did not go through.

On the server: getUserSession

server/api/app-acme/greeting.get.ts
export default defineEventHandler(async (event) => {
  // This route answers one visitor, so no shared cache may store it.
  markVisitorResponse(event);
  const session = await getUserSession(event);
  return session.status === 'authenticated' ? { hello: session.identity.subject.displayName } : { hello: null };
});

getUserSession(event) answers the full session, server-side claims included. It asks the driver at most once per request.

A response that a shared cache may store never carries a visitor's session. On such a request getUserSession answers unknown without asking the driver, and no session cookie is written. A request counts as one visitor's only when:

  • orchestr decided visitor for it — an action or query the browser sends with fetchTurboStream; or
  • the route called markVisitorResponse(event), which also sets Cache-Control: private, no-store.

Every other request is shared — a page render included. A per-visitor route of your own calls markVisitorResponse(event) before it reads the session.

Two more rules hold whatever the route does:

  • A route rule that stores the response wins. Nitro's route cache and Vercel ISR ignore Cache-Control, so a GET whose path a cache, swr or isr rule covers stays shared even after markVisitorResponse. Give your per-visitor route a rule of its own, such as { cache: false, swr: false, isr: false }, when a broad rule covers it. Frontend Core does this for its session routes, and Shopify for its login callback.
  • A signed-in read turns orchestr's caches off for that request. orchestr keys its caches by entity and market, never by visitor. When a query or action handler reads a signed-in visitor with getUserSession, nothing that request produces is stored, so one shopper's answer never reaches another.

Session hooks

HookSideWhen
frontend-core:session:resolvedbrowserevery session answer the browser applies
frontend-core:session:signed-inbrowsera real sign-in, never the page load of a visitor who was already signed in
frontend-core:session:signed-outbrowsera sign-out within the page
frontend-core:session:beginservera login completed
frontend-core:session:endservera session ended: signed out, refresh refused, or token rejected

Payloads and examples: Hooks → User Session. An app that keeps state for the session — a cart, a wishlist — cleans it up in frontend-core:session:end and deletes only its own cookies.

Analytics

The session context of every event reports authStatus and, for a signed-in visitor, a hashed customerId. web/login and web/logout fire once per real transition. A destination may declare identify(subject) and reset(): identify follows the destination's own consent, goes ahead of every event that waits with it, and comes once per page load and again when the visitor changes; reset reaches every destination that has started, whatever the consent. See Tracking.

Cookies

CookieHoldsLifetime
laioutr_session_hint1, nothing else. Readable by script.30 days, renewed by each signed-in answer
laioutr_session_handshakethe page a login started on, then its outcome10 minutes, read once

laioutr_session_hint tells the storefront whether the browser has a session worth asking for, so a browser without a session sends no session request. It names no one: a script on the page can tell that the browser has a session, but not whose. Whether it needs consent or a mention in your cookie notice is yours to judge. The driver adds its own cookies; see its app page.

Limits

  • One driver per storefront. With two apps that bring one, the storefront uses the app whose module is set up first, and the build log warns.
  • A session belongs to one domain. A visitor who moves to another market domain arrives signed out there.
  • A visitor who signs out on the login provider's own pages stays signed in on the storefront until the storefront's next refresh is refused.
  • After sign-out the provider sends the browser where it sends it; the visitor does not return to the page they left.
  • A login or logout through a connector's own auth action (for example ecommerce/auth/oauth-callback) changes the session but fires no web/login or web/logout.
  • The Studio preview always renders signed out.
Copyright © 2026 Laioutr GmbH