Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Detecting session invalidation / expiration in .NET 9 Blazor

$
0
0

I'm developing a Blazor Server application with ASP.NET Core Identity and cookie-based authentication. I have implemented sliding expiration for the authentication cookie.

The challenge is to force an immediate redirection to an "inactive session" page when the session is invalidated. Inactivity, network issues, don't care.

If the server begins to clean up the session for any reason then attempt to redirect.

This is crucial to avoid situations where the user continues interacting with the app after their session has expired, only to experience errors or lost data when trying to submit forms or make server requests. this is usually related to inactivity but other situations may apply. Currently the app just locks up.

Redirecting on the next client server interaction is way to late. You can interact a lot with a Blazor app without having to make a round trip.

Specifically, I need the server to detect when the session has been invalidated (for any reason, not just inactivity) and automatically redirect the user to the /inactive-session page before any interaction with the app takes place.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>