Supabase session lost after new V0 preview or message

Current behavior:

I’m using Supabase authentication and storage to persist user sessions in my V0 project. It works fine in both deployed and preview environments—when I log in and refresh the page (F5), I remain logged in and see the dashboard (expected behavior).

However, when I start a new message or generate a new preview, the session is lost, and I’m redirected back to the login screen. This interrupts the flow and slows down my development.

Expected behavior:

Once a user is logged in on a preview, they should remain logged in—even when generating a new preview or starting a new message—so long as the preview environment isn’t truly sandboxed or cleared.

** Steps to reproduce**

  1. Deploy a V0 project using Supabase auth.
  2. Log in through the preview link.
  3. Refresh the page → user stays logged in
  4. Go back to V0, send a new message to continue building → generate a new preview
  5. Open the new preview → session is gone

** Project information**

  • Project type: V0 project integrated with Supabase (not hosted on Vercel)
  • Environment: Preview mode (in V0)
  • Frontend: Next.js (App Router)
  • Backend/auth: Supabase
  • Session persistence: Using Supabase client-side storage (localStorage/session)

Questions

  • Is this expected behavior from V0 (e.g., do new previews reset local/session storage)?
  • Is there a way to persist Supabase sessions across previews?
  • Any best practices to avoid logging in every single time a preview is regenerated?

Would really appreciate any insights or workarounds—this is currently a blocker in my workflow.

Thanks in advance!

Did you know about these other v0 resources? A human should be here soon to help, but the answer may already be available even faster in one of these other posts.

This guide is a great place to start.

And these recordings can give you a look at v0 features and strategies in action: Topics tagged v0