#12934·neon

getSession() returns null right after a successful sign-in when the app runs as an installed iOS PWA

Author: kubzejCreated Aug 21, 2026Updated Aug 21, 2026
Labelst/bug

Hello,

Email/password sign-in works reliably in a normal Safari tab, but fails silently when the same app is installed via "Add to Home Screen" and opened in standalone mode. The sign-in request itself succeeds and returns a valid user + token, but the very next getSession() call comes back empty, so the app has no way to tell the user actually got signed in and just bounces them back to the login screen with no error. Root cause looks like iOS's isolated storage container for installed PWAs not persisting the cross-origin session cookie that Neon Auth sets. This makes the SDK effectively unusable for any app meant to be installed as a home-screen PWA on iOS.

Steps to reproduce

  1. Deploy a Vite/React SPA using @neondatabase/auth (createInternalNeonAuth + BetterAuthReactAdapter) for email/password auth, calling a Neon Auth instance on its own subdomain (different origin from the app).
  2. On iOS Safari, open the app and use Add to Home Screen to install it as a standalone PWA.
  3. Open the installed app from the home screen icon (not from a regular Safari tab).
  4. Sign in with a valid email/password via client.signIn.email({ email, password }). Immediately after, the app calls client.getSession() (as recommended, to confirm the session before treating the user as signed in).

Expected result

getSession() returns the active session/user, matching the behavior seen when running the exact same app in a regular Safari tab (not installed), where sign-in works reliably.

Actual result

The POST .../sign-in/email request succeeds (200) and returns a full payload including the user object and a token:

{ "redirect": false, "token": "", "user": { "name": "", "email": "", "emailVerified": false, "id": "", ... } } The immediately following getSession() call (GET .../get-session) returns null. The app has no way to distinguish "genuinely signed out" from "session cookie didn't persist" — no error is thrown anywhere in the flow, getSession() just resolves with no session, so the UI silently stays on the login screen. This reproduces every time in the installed/standalone context, and never in a regular Safari tab on the same device with the same credentials.

Environment

@neondatabase/auth: 0.5.0-beta Adapter: BetterAuthReactAdapter Frontend: Vite + React 19 PWA Device/OS: iPhone, iOS 26.6, Safari 26.5.2 — reproduces only in the installed/standalone PWA, not in a regular Safari tab