I'm trying to handle ASP.net MVC 5, timeout session scenario. Here is my code I'm using which is working as well for session expiry.
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
ExpireTimeSpan = 200,
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Home/Index"),
SlidingExpiration=true,
Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = ApplicationCookieIdentityValidator.OnValidateIdentity(
validateInterval: TimeSpan.FromMinutes(1),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
}
});
I have to extend/override this expiry whenever user is shown a popup for the expiry of the session. Is there any workaround of overriding or extending the timeout just before it's actual expiry. I need a solution which can be integrated across all the application, Maybe 1 ajax centralized call to server to do that or any other options if there is any?
Thanks.