# Maintaining a session even when you refresh the browser

**URL:** <https://community.auth0.com/t/maintaining-a-session-even-when-you-refresh-the-browser/114983>\
**Category:** Get Help\
**Tags:** authentication-sessions, sessions\
**Created:** [August 29, 2023, 5:56pm UTC](https://community.auth0.com/t/maintaining-a-session-even-when-you-refresh-the-browser/114983 "2023-08-29T17:56:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![thatguycodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thatguycodes/32/48068_2.png) [@thatguycodes](https://community.auth0.com/u/thatguycodes)\
**Post date:** [August 29, 2023, 5:56pm UTC](https://community.auth0.com/t/maintaining-a-session-even-when-you-refresh-the-browser/114983/1 "2023-08-29T17:56:46Z")

</div>

Hi, I need advice on maintaining a session despite a user refreshing the browser. I am migrating my codebase to auth0 from a custom authentication service. I’m struggling to figure out what to extract and how to store it on the browser so that when I refresh the browser the access token/id can be retrieved to keep a user logged in. The example by Auth0 loses state and I keep having to log in to resume interacting with my app. Please help.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [August 30, 2023, 1:08am UTC](https://community.auth0.com/t/maintaining-a-session-even-when-you-refresh-the-browser/114983/3 "2023-08-30T01:08:33Z")

</div>

Hi @thatguycodes,

Welcome to the Auth0 Community!

Firstly, you can maintain a session by [configuring the session lifetime settings](https://auth0.com/docs/manage-users/sessions/configure-session-lifetime-settings).

By default, users have an **Inactivity Timeout** of 3 days and **Requires log in after** 30 days.

If you need to maintain this session without prompting the user for credentials, you could [Configure Silent Authentication](https://auth0.com/docs/authenticate/login/configure-silent-authentication) or [Configure Refresh Token Rotation](https://auth0.com/docs/secure/tokens/refresh-tokens/configure-refresh-token-rotation).

Please let me know if you have any questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![thatguycodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thatguycodes/32/48068_2.png) [@thatguycodes](https://community.auth0.com/u/thatguycodes)\
**Post date:** [August 30, 2023, 1:00pm UTC](https://community.auth0.com/t/maintaining-a-session-even-when-you-refresh-the-browser/114983/4 "2023-08-30T13:00:39Z")

</div>

I have set this up correctly. However, on the Angular app, which the client app that is integrated with Auth0. I seem to get logged out each time I refresh the browser. I was wondering if you could point me to the right direction on how to make sure that when a token is refreshed, I"m not logged out in the process.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [August 30, 2023, 3:11pm UTC](https://community.auth0.com/t/maintaining-a-session-even-when-you-refresh-the-browser/114983/5 "2023-08-30T15:11:31Z")

</div>

HI @thatguycodes,

Thanks for following up.

Could you please [capture the login events in a HAR file](https://auth0.com/docs/troubleshoot/troubleshooting-tools/generate-and-analyze-har-files) and send them to me in a direct message to look into this further?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![thatguycodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thatguycodes/32/48068_2.png) [@thatguycodes](https://community.auth0.com/u/thatguycodes)\
**Post date:** [August 30, 2023, 5:08pm UTC](https://community.auth0.com/t/maintaining-a-session-even-when-you-refresh-the-browser/114983/6 "2023-08-30T17:08:24Z")

</div>

After restarting my laptop the issues just resolved themselves. So I will blame it on cache for now. Thank you for your time. When I run into other issues I will open a new topic if the topic doesn’t exist.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [August 31, 2023, 5:10pm UTC](https://community.auth0.com/t/maintaining-a-session-even-when-you-refresh-the-browser/114983/7 "2023-08-31T17:10:26Z")

</div>

Hi @thatguycodes,

Thanks for following up, and I’m glad it worked after resetting your machine.

It may be possible that something was cached and behaving incorrectly.

Please feel free to reach out if you have any additional questions. We are here to help!

Thanks,  
Rueben

---

<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 14, 2023, 5:11pm UTC](https://community.auth0.com/t/maintaining-a-session-even-when-you-refresh-the-browser/114983/8 "2023-09-14T17:11:22Z")

</div>

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