© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
10 replies
stukennedy

supabase.auth logging out server-side

So ... I'm using Supabase on my own site that uses SSR.
I'm managing to do the login using magic links, by getting the URL hash and storing as a cookie.
Then I've created my own
getSupabase
getSupabase
method for the backend that retrieves the JWT from the cookie and sets the session using
supabase.auth.setSesssion(...)
supabase.auth.setSesssion(...)

That all works nicely and I can call the api etc.
Problem is when I try to logout.
I've tried a bunch of things.
I delete the cookies and try to call
setSession
setSession
and
refreshSession
refreshSession
(which shouldn't work as it has no tokens to work on anymore from the cookies) but it still returns a user until I manually refresh the page again.
What am I doing wrong?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Server side auth via the supabase React client
SupabaseSSupabase / help-and-questions
4y ago
Different Supabase URL for client side and server side breaks auth
SupabaseSSupabase / help-and-questions
5mo ago
Is it possible to have both server side auth and client side auth nextjs + supabase
SupabaseSSupabase / help-and-questions
4mo ago
Using Supabase in NextJS Server Side
SupabaseSSupabase / help-and-questions
13mo ago