How to persist Supabase Auth session in WeWeb — keep user logged in after closing the tab + logout button

Hi everyone — quick question and a short explanation of my current problem and solution I’m trying to implement.

Goal: keep the user logged in after closing the tab/browser and reopening the app, and implement a proper logout button. I’m using Supabase Auth (via WeWeb).

Short summary of the approach

  1. Persist the session (access + refresh tokens) after login.

  2. Logout by calling Supabase signOut() and clearing stored tokens.

Hi Muntean, welcome to the community :waving_hand:

Since you are using the Supabase Auth plugin in WeWeb, the user session is already persisted by default, so you usually don’t need to manually store the access and refresh tokens yourself. As long as the user logs in through the plugin and you don’t explicitly clear the session, they should remain logged in when they close and reopen the tab.​

To implement logout, the recommended approach is to use the Supabase Auth plugin’s “Sign out” action in a workflow on your logout button, which will clear the stored session correctly.

Now, if you are still seeing the user get logged out after closing the browser, can you share your setup (screenshots of the auth plugin config and login/logout workflows)?,

because that would indicate a specific implementation issue rather than expected behavior.

Makes sense? Let me know if you figure it out :slight_smile:

1 Like