Authentication is lost after page refresh

We have had a working auth0 setup for a year or so and after a recent update made by auth0, we are having this very same issue with isAuthenticated. We haven’t changed our login scripts for 6 months at a least. Please look into this. This is breaking the workflow for our users.

Hi @JoshuaAYoung,

I went ahead and moved this response to a new topic from the topic How to keep login session when refreshing page in SPA

To see if this might be caused by blocked third-party cookies as described in the FAQ, have you tried temporarily configuring your browser to allow third-party cookies?

chrome://settings/cookies

We haven’t changed anything about our auth0 setup for the last 6 months and our users just started to experience this issue. We cannot tell all of our users to turn on third-party cookies. There has to have been something changed in the way auth0 deals with session storage in the last few weeks. Would love to know what that is and how to reverse it. Do I need to change the “type” of application from an SPA (even though it IS an spa) in order to save the session when changing tabs?

Hi @JoshuaAYoung,

I’m not aware of any recent changes in how sessions are dealt with that would cause auth to be lost. Blocked third-party cookies are an increasing cause of this behavior because it is the default setting in some browsers, including Safari.

Changing the type of application should not affect this behavior. I’d suggest testing your application with third-party cookies blocked in the browser and not blocked in the browser in order to confirm if that is the issue. If the auth is lost after refresh only when third-party cookies are blocked, then that will confirm why the auth is lost after refresh.

Once confirmed, you can resolve the issue by either using a Custom Domain or adjusting the cache location that is set in the Auth0Provider component. A code example is provided here: Why is authentication lost after refreshing my single page application?

1 Like

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