# Keep users connected longer with JWT SPA

**URL:** <https://community.auth0.com/t/keep-users-connected-longer-with-jwt-spa/56083>\
**Category:** Get Help\
**Created:** [January 12, 2021, 6:05pm UTC](https://community.auth0.com/t/keep-users-connected-longer-with-jwt-spa/56083 "2021-01-12T18:05:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![baptiste1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/baptiste1/32/16235_2.png) [@baptiste1](https://community.auth0.com/u/baptiste1)\
**Post date:** [January 12, 2021, 6:05pm UTC](https://community.auth0.com/t/keep-users-connected-longer-with-jwt-spa/56083/1 "2021-01-12T18:05:58Z")

</div>

Hi all,

Our users are asking to stay connected longer.  
We use JWT on a SPA and the default React Auth0 toolkit.

I tried:

- activate the refresh token rotation in the Application API tab Put 2 years in validity period.
- added in the React toolkit  
\<Auth0Provider  
domain=“…”  
clientId=“…”  
redirectUri=“…”  
useRefreshTokens  
cacheLocation=“localstorage”  
audience=“…”

> 

- I used getAccessTokenSilently to retreive the JWT

What I am missing?  
Thanks

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 13, 2021, 8:54pm UTC](https://community.auth0.com/t/keep-users-connected-longer-with-jwt-spa/56083/3 "2021-01-13T20:54:50Z")

</div>

Hi @baptiste1,

Are your users sessions expiring before you expect them to?

You configured the refresh token settings in the dashboard?

> **[Configure Refresh Token Expiration](https://auth0.com/docs/secure/tokens/refresh-tokens/configure-refresh-token-expiration)**
>
> Learn how to configure the refresh token expiration lifetimes.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 12, 2021, 6:20pm UTC](https://community.auth0.com/t/keep-users-connected-longer-with-jwt-spa/56083/4 "2021-02-12T18:20:37Z")

</div>

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