Single Log Out from SPAs Opened in Different Windows Without Relying on 3rd party Cookies

Overview

This article explains if a user can be logged out of multiple applications In a scenario where a user has two open windows or tabs, each containing a different logged-in Application, and the user logs out of one of the applications.  Is this possible without relying on third-party cookies, as they are unavailable on some browsers?

Applies To

  • Log Out
  • Silent Authentication

Solution

When 3rd party cookies are available, leverage silent authentication to check if the user has an active session with the Auth0 Layer.


If the user has no session, the silent auth method will return an error with the message "Login required." After catching this error, you can poll the session periodically and log the user out from the Application.

However, this approach does not work if 3rd party cookies are unavailable since an Auth0 Tenant stores its session in a cookie.

If applications share a parent domain, you can leverage the "cookieDomain" option:

This will ensure the cookie is accessible across multiple subdomains.

Single Log Out across multiple windows/tabs will not be available if the applications do not share a parent domain.

NOTE: Be careful about the polling cadence to avoid rate limiting.

Recommended content

No recommended content found...