How to keep login session when refreshing page in SPA

Hi there,
Following the instruction on Auth0 React SDK Quickstarts: Login, I am able to let user login to my react SPA.
I am using isAuthenticated from useAuth0(); to check if user is logged in. This works well when user navigates among pages.
However if user refresh browser, isAuthenticated return false , so user has to login again.
I wanna keep login session for a period of time, and wanna rely on Auth0 to do that job without launching my own server to manage the session.
Is there a way to do that ?

Hi @hxnam0509,

There are a couple of different causes that may be resulting in your application losing authentication after the page refreshes. This article explains the two most common reasons (developer keys & blocked third-party cookies).

Let me know if the FAQ solves this!

1 Like

A post was split to a new topic: Authentication is lost after page refresh

Thanks so much @stephanie.chamblee , the FAQ solves my problem.

Btw I think you guys should add this FAQ to your tutorial on Auth0 React SDK Quickstarts: Login, it is difficult for beginners to find out this info. Your tutorial doesn’t seem to be complete.

Hi @hxnam0509,

I’m glad that the FAQ helped get you through the blocker! Thank you for the feedback regarding the Quickstart.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.