© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
7 replies
Fyris

signOut doesn't remove session from local storage

Hey, I am experimenting with supabase. I like it so far, but I have encountered problems with signing out.
When I use
supabase.auth.signOut()
supabase.auth.signOut()
request is sent, however token inside local storage is not removed. Due to that
supabase.auth.user()
supabase.auth.user()
returns valid user object and not null.
I inspected
signOut
signOut
method and it is supposed to remove item in local storage with session, however this is not done.
I need to to it manually by myself with
localStorage.removeItem(STORAGE_KEY)
localStorage.removeItem(STORAGE_KEY)
.

Had anybody seen similar problem like this?

Here's code I have used:
    const handleSignOut = async () => {
        await getClient().auth.signOut();
        localStorage.removeItem(STORAGE_KEY); // this is mandatory, otherwise signing out doesn't work
        setUser(null)
    }
    const handleSignOut = async () => {
        await getClient().auth.signOut();
        localStorage.removeItem(STORAGE_KEY); // this is mandatory, otherwise signing out doesn't work
        setUser(null)
    }
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

remove() doesn't seem to remove the file from a bucket
SupabaseSSupabase / help-and-questions
6mo ago
Local Storage Questions
SupabaseSSupabase / help-and-questions
4y ago
Remove current session (Flutter)
SupabaseSSupabase / help-and-questions
4y ago
Why doesn't auth use Session Storage when persistSession is set to false?
SupabaseSSupabase / help-and-questions
4y ago