© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
nish

Using cookies vs localstorage

Sorry if this has been asked before. I wasn't able to find any information. I noticed that the session is sometimes stored in localStorage and sometimes in cookies. Is using the storageKey parameter in createClient the correct way to enforce localStorage usage? What is the correct way to enforce cookie usage, and set cookie name?

Another related issue is that I am not seeing an option to clear the cookie / localStorage on signout. If the current session is valid the user can signout without an issue but if the token or session has expired signOut doesn't work leaving the user with a stale session he can't exit.

Any ideas?
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

localstorage exception
SupabaseSSupabase / help-and-questions
4y ago
Can I use cookies instead of storing supabase.auth.token to localStorage
SupabaseSSupabase / help-and-questions
4y ago
I'm using Auth with Cookies
SupabaseSSupabase / help-and-questions
3y ago
httponly cookies
SupabaseSSupabase / help-and-questions
4y ago