10

I'm programming an MVC3 application. Now I hava to call a script if the users session expire.

Is there something like a event on-session-expire, that get fired when the user session expired?

Thanks a lot!

HW90
  • 1,953
  • 2
  • 21
  • 45

1 Answers1

10

In your Global.asax you can create a

protected void Session_End(object sender, EventArgs e) { }

method which should be called when a session ends.

Ron Sijm
  • 8,490
  • 2
  • 31
  • 48
  • 13
    It is worth mentioning that this event is never triggered if you use out of process session state. It works only with InProc mode. – Darin Dimitrov Dec 13 '11 at 12:13