Soenneker.Blazor.Utils.Session 4.0.2698

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Blazor.Utils.Session --version 4.0.2698
                    
NuGet\Install-Package Soenneker.Blazor.Utils.Session -Version 4.0.2698
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Blazor.Utils.Session" Version="4.0.2698" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.Utils.Session" Version="4.0.2698" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.Utils.Session" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Blazor.Utils.Session --version 4.0.2698
                    
#r "nuget: Soenneker.Blazor.Utils.Session, 4.0.2698"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Blazor.Utils.Session@4.0.2698
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Blazor.Utils.Session&version=4.0.2698
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.Utils.Session&version=4.0.2698
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Blazor.Utils.Session

Provides session management utilities for Blazor applications, including access-token caching and optional idle-timeout navigation.

Install

dotnet add package Soenneker.Blazor.Utils.Session

Quick start

using Soenneker.Blazor.Utils.Session.Registrars;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();
var result = services.AddSessionUtilAsScoped();

Shorthand for services.AddScoped.

What you get

  • ISessionUtil — Provides session management utilities for Blazor applications, including access-token caching and optional idle-timeout navigation.
  • SessionUtilRegistrar — A Blazor utility for access-token caching and optional idle-timeout navigation.

API at a glance

API What it does Result / important behavior
ISessionUtil.UpdateWithAccessToken(expiration, cancellationToken) Updates cached access-token expiration using the specified JWT expiration time. Cancels any existing token-expiration timer and schedules a new background task to clear the cached token. A ValueTask that completes once the expiration update has been applied.
ISessionUtil.ClearStateAndRedirect(error, cancellationToken) Clears all session state and navigates to the configured expiration page. A ValueTask that completes once the state has been cleared and navigation has started.
ISessionUtil.ClearState() Clears the JWT expiration and cancels any pending expiration timer without performing a navigation redirect. A ValueTask that completes once the session state has been cleared.
SessionUtilRegistrar.AddSessionUtilAsScoped(services) Shorthand for services.AddScoped. The same service collection, so additional registrations can be chained.

Important behavior

  • ISessionUtil: The session expiration redirect target is configurable via the Session:Uri configuration value. This service is intended for scoped dependency injection in Blazor WebAssembly.

Practical notes

  • Cancellation stops pending work; it does not undo work that has already completed.
  • Calls that return a cached or singleton value reuse the same instance until the owning service is disposed.
  • Dispose instances you own when their scope ends so held resources can be released.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Blazor.Utils.Session:

Package Downloads
Soenneker.Blazor.ApiClient

A lightweight and efficient API client wrapper for Blazor applications, simplifying HTTP communication with support for asynchronous calls, cancellation tokens, and JSON serialization.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.2712 0 8/30/2026
4.0.2710 0 8/30/2026
4.0.2707 0 8/30/2026
4.0.2705 31 8/30/2026
4.0.2704 46 8/30/2026
4.0.2702 37 8/30/2026
4.0.2698 35 8/29/2026
4.0.2697 41 8/29/2026
4.0.2696 41 8/29/2026
4.0.2695 30 8/29/2026
4.0.2694 324 8/26/2026
4.0.2693 152 8/26/2026
4.0.2692 158 8/25/2026
4.0.2691 355 8/21/2026
4.0.2689 105 8/21/2026
4.0.2688 507 8/18/2026
4.0.2687 151 8/18/2026
4.0.2686 385 8/13/2026
4.0.2685 196 8/12/2026
4.0.2684 96 8/12/2026
Loading failed

Improve README usability and API guidance