checkSession returns login_required after a few successful calls when using Universal Login with a Custom Domain

Title: checkSession returns login_required after a few successful calls when using Universal Login with a Custom Domain

Hi everyone,

I’m facing an issue with auth0.checkSession() and would appreciate any guidance.

Setup:

  • Application Type: Machine-to-Machine (M2M)
  • Authentication: Universal Login
  • SDK: Auth0.js
  • Custom Domain: Enabled

Issue:

A user logs in successfully and the Auth0 session is maintained. After login, I call auth0.checkSession() approximately every 4 minutes to verify whether the user still has an active session.

Initially, checkSession() works as expected. However, after 2–3 successful checks, it starts failing with the following error:

login_required

This happens even though the user has not logged out and the session is expected to remain active.

Questions:

  1. What could cause checkSession() to start returning login_required after a few successful calls?
  2. Could this be related to session settings, browser behavior, or the use of a custom domain?
  3. Are there any recommended configurations or best practices to prevent this issue?

Any suggestions or troubleshooting steps would be greatly appreciated.

Thank you!