2

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?

svick
  • 214,528
  • 47
  • 357
  • 477
Haseeb Jadoon
  • 350
  • 5
  • 20
  • Hi, did you manage to implement this? could you lead me with some example on how to create and plug a custom session state store provider in .net core? – acromm Oct 23 '19 at 14:01
  • @acromm please check out the accepted answer. Sessions have changed in .Net Core so you need to implement them differently now. – Haseeb Jadoon Oct 24 '19 at 01:15

2 Answers2

2

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

Tratcher
  • 5,371
  • 26
  • 42
1

This is more relevant now: https://docs.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

ZagNut
  • 1,363
  • 12
  • 18
  • Warning: Apparently they have removed this totally in asp.net 6! (At least there's no documentation for it) – Poul Bak May 19 '21 at 13:23