ASP.NET - Redis Session State Provider - Session_End

I am using RedisSessionStateProvider in an ASP.NET MVC application.

Everything works fine, except that the Session_End event Session_End never raised.

 protected void Session_End(object sender, EventArgs e) { // Do stuff whenever a session ends } 

Here is my web.config:

 <sessionState mode="Custom" customProvider="RedisSessionProvider" timeout="1"> <providers> <add name="RedisSessionProvider" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="localhost:6379" accessKey="" ssl="false"/> </providers> </sessionState> 

Versions:

  • Windows 10 Pro
  • ASP.NET MVC 5.2.2
  • Redis 2.8.2104 64-bit
  • Microsoft.Web.RedisSessionStateProvider 1.6.5

What is the correct way to implement custom logic whenever a session ends using RedisSessionStateProvider?

+6
source share
1 answer

Has anyone got a solution for this? I am facing the same issue with the latest RedisSessionStateProvider.

Thank you in advance!!!

Ragards, Buddha T

0
source

Source: https://habr.com/ru/post/1236981/


All Articles