# Keeping user logged in on page refresh

**URL:** <https://community.auth0.com/t/keeping-user-logged-in-on-page-refresh/85366>\
**Category:** Get Help\
**Created:** [June 19, 2022, 11:28am UTC](https://community.auth0.com/t/keeping-user-logged-in-on-page-refresh/85366 "2022-06-19T11:28:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![devinat1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/devinat1/32/38137_2.png) [@devinat1](https://community.auth0.com/u/devinat1)\
**Post date:** [June 19, 2022, 11:28am UTC](https://community.auth0.com/t/keeping-user-logged-in-on-page-refresh/85366/1 "2022-06-19T11:28:51Z")

</div>

I have been following this tutorial to implement auth0 on my SPA React application: [The Complete Guide to React User Authentication with Auth0](https://auth0.com/blog/complete-guide-to-react-user-authentication/)  
I have implemented everything in the blog. When I click on react router routes, the auth0 info is still saved and all information shows without having to re-authenticate. However, when I refresh the page, I get logged out and have to log in again. This happens silently, but it is tedious having to reauthenticate after reloading a page.  
Is there a way to keep the user logged in even upon refresh of the page, up until the user clears cookies?

---

<div class="post-metadata">

**Author:** ![alex.brett](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alex.brett/32/60157_2.png) [@alex.brett](https://community.auth0.com/u/alex.brett)\
**Post date:** [December 3, 2024, 8:14pm UTC](https://community.auth0.com/t/keeping-user-logged-in-on-page-refresh/85366/2 "2024-12-03T20:14:20Z")

</div>

Hello @devinat1! I understand your SPA logs you out after refresh the page.

I found a [knowledge article](https://community.auth0.com/t/authentication-lost-after-refreshing-an-spa/117733) that gives a few reasons for this. Please read it over and see if any relate to you.

I hope this helps!

Best,  
Alex

---

<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:** [December 17, 2024, 8:15pm UTC](https://community.auth0.com/t/keeping-user-logged-in-on-page-refresh/85366/3 "2024-12-17T20:15:00Z")

</div>

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