# Refresh Token for reload page

**URL:** <https://community.auth0.com/t/refresh-token-for-reload-page/69299>\
**Category:** Get Help\
**Tags:** react, auth0js, auth0\
**Created:** [September 8, 2021, 1:12pm UTC](https://community.auth0.com/t/refresh-token-for-reload-page/69299 "2021-09-08T13:12:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![phu0n9](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/phu0n9/32/31615_2.png) [@phu0n9](https://community.auth0.com/u/phu0n9)\
**Post date:** [September 8, 2021, 1:12pm UTC](https://community.auth0.com/t/refresh-token-for-reload-page/69299/1 "2021-09-08T13:12:04Z")

</div>

Hi there,  
I am using the MERN stack website for Auth0. And every time I refresh the page, it redirects to the Auth0 login page while the session cookie is not expired yet. I did the same with the Auth0 tutorial and i have set

```auto
      useRefreshTokens={true}

```

to true but somehow it does not work.  
Please helpppp

---

<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:** [September 9, 2021, 10:10pm UTC](https://community.auth0.com/t/refresh-token-for-reload-page/69299/3 "2021-09-09T22:10:19Z")

</div>

Hi @phu0n9,

Try adding the cacheLocation option as well. See this topic for more info:

[https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application/56276](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application/56276)

---

<div class="post-metadata">

**Author:** ![phu0n9](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/phu0n9/32/31615_2.png) [@phu0n9](https://community.auth0.com/u/phu0n9)\
**Post date:** [September 10, 2021, 10:22am UTC](https://community.auth0.com/t/refresh-token-for-reload-page/69299/4 "2021-09-10T10:22:32Z")

</div>

omg thank you so much. It works !!! But is it safe to save the key in local storage? What is the alternative way to store it?  
Anyway thank you so so much.

---

<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:** [September 13, 2021, 3:36pm UTC](https://community.auth0.com/t/refresh-token-for-reload-page/69299/5 "2021-09-13T15:36:11Z")

</div>

Take a look at this blog post that explains it:

> **[Securing Single Page Applications with Refresh Token Rotation](https://auth0.com/blog/securing-single-page-applications-with-refresh-token-rotation/)**
>
> How Auth0 helps you securely maintain user sessions and engagement in the era of ITP

---

<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:** [September 28, 2021, 3:37pm UTC](https://community.auth0.com/t/refresh-token-for-reload-page/69299/6 "2021-09-28T15:37:13Z")

</div>

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