I am using ASP.NET Identity 2.0
in ASP.NET MVC 5 application and for some reason I am storing some data in database which has to be cleaned after the user is logged out. I set ExpireTimeSpan = TimeSpan.FromMinutes(sessionTimeOut)
property in CookieAuthenticationProvider
but I need to execute a method after the TimeSpan
has expired. I tried to add Session_End
method in Global.asax
but did not work.
Is there any way to execute a callback function when the user is automatically logged out from the system ?
答案 0 :(得分:1)
@Tommy和@Kevin B Burns建议我找不到ASP.MVC
本身提供的特定解决方案,但最终使用Quartz.NET
作业调度程序执行特定时间以进行清理数据库中。