© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
11 replies
j4

How to refresh a session in v2

Since this got merged, I can't figure out how to refresh a session. The new
setSession()
setSession()
will only refresh your tokens if the
access_token
access_token
has expired. Before this merge,
setSession()
setSession()
would give you new tokens even if the access_token was still valid.

Or am I just missing something? (the most likely scenario)

https://github.com/supabase/gotrue-js/pull/467
GitHub
feat: update setSession by kangmingtay · Pull Request #467 · supaba...
What kind of change does this PR introduce?

Fixes setSession to make it safe to use in a server-side or SSR context
setSession should take in an access token and refresh token and only perform a r...
feat: update setSession by kangmingtay · Pull Request #467 · supaba...
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

How to refresh session for Google oAuth?
SupabaseSSupabase / help-and-questions
3y ago
How to refresh the session with no access to `refresh_token`?
SupabaseSSupabase / help-and-questions
3y ago
refresh session error
SupabaseSSupabase / help-and-questions
4y ago
How to get the active session synchronously in v2.x
SupabaseSSupabase / help-and-questions
4y ago