Implementing Custom Session State Store Provider in dotnet core

2.6k Views Asked by At

I was just planning to implement a custom session state provider for a distributed cache product in .net core but I could not find SessionStateStoreProviderBase and related classes in dotnet core. Can somebody tell me where to find them?

2

There are 2 best solutions below

0
On BEST ANSWER

Session is very different in ASP.NET Core. It's designed around IDistributedCache and takes the implementation from DI. https://github.com/aspnet/Caching/blob/rel/1.1.2/src/Microsoft.Extensions.Caching.Abstractions/IDistributedCache.cs

1
On

This is more relevant now: https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.session?view=aspnetcore-2.2

I believe you'll want to inject in your own ISessionStore for the SessionManager to pick up. SessionManager