# How to resume session after browser is closed then re-opened

**URL:** <https://community.auth0.com/t/how-to-resume-session-after-browser-is-closed-then-re-opened/84615>\
**Category:** Get Help\
**Tags:** net-core\
**Created:** [June 5, 2022, 5:41pm UTC](https://community.auth0.com/t/how-to-resume-session-after-browser-is-closed-then-re-opened/84615 "2022-06-05T17:41:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hbax450](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hbax450/32/33711_2.png) [@hbax450](https://community.auth0.com/u/hbax450)\
**Post date:** [June 5, 2022, 5:41pm UTC](https://community.auth0.com/t/how-to-resume-session-after-browser-is-closed-then-re-opened/84615/1 "2022-06-05T17:41:01Z")

</div>

I am using the Auth0.ASPNetCore.Authentication SDK in my Blazor Server app. Using persistent sessions, all is working. However, after a user closes their browser, then re-accesses the site, Blazor does not restore the authentication session. Instead, the user needs to hit the Login page which then restores the session (without having to log in again).

Is there a way to configure the app to determine this without having to revisit the login page?

---

<div class="post-metadata">

**Author:** ![mj.phong](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mj.phong/32/37722_2.png) [@mj.phong](https://community.auth0.com/u/mj.phong)\
**Post date:** [June 7, 2022, 8:35am UTC](https://community.auth0.com/t/how-to-resume-session-after-browser-is-closed-then-re-opened/84615/2 "2022-06-07T08:35:51Z")

</div>

Hi @hbax450  
Base on the concept of Auth0, the end-user is authenticated by the access\_token, it will be generated when the sign in is success, and it is the communication key of Auth0 vs your application. My suggestion is keeping the access\_token in the cookie, collect it when the end-user re-access your application, then verify it with Auth0 platform.

The step by step should be:

1. Collect the access\_token from the cookie. Verify it with Auth0 platform.

- If it is valid, then go to step 3
- If not, redirect the end-user to the login page (step 2)

1. Login, collect the access\_token and store it in the cookie
2. Collect the end-user information, keep them going on your application.

Hope this helps.  
Mj.

---

<div class="post-metadata">

**Author:** ![Brian\_Stewart](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brian_stewart/32/42188_2.png) [@Brian\_Stewart](https://community.auth0.com/u/Brian_Stewart)\
**Post date:** [December 27, 2022, 6:31pm UTC](https://community.auth0.com/t/how-to-resume-session-after-browser-is-closed-then-re-opened/84615/3 "2022-12-27T18:31:47Z")

</div>

The issue is not Auth0.  
It is due to Blazor working client side. When you close the browser the blazor signalr circuit (in the case of blazor server) is disposed so the user session is removed.  
The way around this is to store the user session information in distributed storage or local storage.

This page on state management with blazor explains it

> **[ASP.NET Core Blazor state management](https://learn.microsoft.com/en-us/aspnet/core/blazor/state-management?view=aspnetcore-3.1&pivots=server#protected-browser-storage-experimental-nuget-package)**
>
> Learn how to persist user data (state) in Blazor apps.

---

<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:** [November 14, 2024, 12:54am UTC](https://community.auth0.com/t/how-to-resume-session-after-browser-is-closed-then-re-opened/84615/4 "2024-11-14T00:54:26Z")

</div>

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