0

I'm using ASP.Net (MVC) and Razor views.

When a user has timed out, they get redirected to the login page. However, I want to display a message that lets them know that they've timed out.

In the Startup.Configuration(IAPPBuilder application) method, I have the following set (partial code)

app.UseCookieAuthentication(new CookieAuthenticationOptions 
{
   LoginPath = new PathString("/Auth/Login"),
   ExpireTimeSpan = System.TimeSpan.FromMinutes(1),
   SlidingExpiration = true
});

I've tried intercepting the redirect in global.asax (Session_End, Session_OnEnd) and controller (OnRequestExecuting) but neither of the global.asax methods are being touched and the OnRequestExecuting doesn't have any values that help me determine if the user is not logged in because they're a new arrival or because they timed out.

Where/How would I intercept the call to be able to determine if I should display a "You waited too long to click something" message?

Bardicer
  • 1,405
  • 4
  • 26
  • 43
  • You can do something like this: http://stackoverflow.com/questions/23090706/how-to-know-when-owin-cookie-will-expire – Fals Mar 29 '16 at 18:52
  • I tried that, my "OnValidateIdentity" task was not hit when I tried to do something after timing out. I just got kicked to the login screen. – Bardicer Mar 29 '16 at 19:03

0 Answers0