# How to check if user has logged out in another tab?

**URL:** <https://community.auth0.com/t/how-to-check-if-user-has-logged-out-in-another-tab/56324>\
**Category:** Get Help\
**Tags:** react-sdk, auth0-react, react\
**Created:** [January 17, 2021, 3:03am UTC](https://community.auth0.com/t/how-to-check-if-user-has-logged-out-in-another-tab/56324 "2021-01-17T03:03:10Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [January 20, 2021, 6:26pm UTC](https://community.auth0.com/t/how-to-check-if-user-has-logged-out-in-another-tab/56324/4 "2021-01-20T18:26:08Z")

</div>

It looks like if you set the `cacheLocation` on the `Auth0Provider` to ‘localstorage’ other tabs will be able to pick up that the user has logged out.

```auto
ReactDOM.render(
  <Auth0Provider
    domain={config.domain}
    clientId={config.clientId}
    audience={config.audience}
    redirectUri={window.location.origin}
    onRedirectCallback={onRedirectCallback}
    useRefreshTokens={true}
    cacheLocation="localstorage"
  >
    <App />
  </Auth0Provider>,
  document.getElementById("root")
);

```

Note about local storage from [this topic](https://community.auth0.com/t/trying-the-new-refresh-token-rotation-in-a-react-spa-are-3rd-party-cookies-supposed-to-be-required/41151/10):

> [@Trying the new Refresh Token Rotation in a React SPA. Are 3rd party cookies supposed to be required?](https://community.auth0.com/t/trying-the-new-refresh-token-rotation-in-a-react-spa-are-3rd-party-cookies-supposed-to-be-required/41151/11):
>
> One thing to do right now to help is ensure that your application is mitigated in the best way possible from XSS attacks from being successful in the first instance:
> 
> - Keep the amount of third-party JavaScript being used to a minimum, and only from trusted sources
> - Use as short an expiry time on your access tokens as is practical

---

_[View the full topic](https://community.auth0.com/t/how-to-check-if-user-has-logged-out-in-another-tab/56324)._
