简体   繁体   中英

Make some clean up after user automatically logged out in Asp.Net Identity

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 ?

正如@Tommy和@Kevin B Burns所建议的那样,我找不到ASP.MVC本身提供的特定解决方案,但最终使用Quartz.NET作业调度程序执行了特定的时间来清理数据库。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM