ASP.NET MVC Session Expiration

前端 未结 6 2060
孤街浪徒
孤街浪徒 2021-01-01 21:51

We have an internal ASP.NET MVC application that requires a logon. Log on works great and does what\'s expected. We have a session expiration of 15 minutes. After sitting on

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-01 22:06

    You might look into the AjaxOptions that can be set in Ajax.BeginForm(). There is an OnBegin setting that you can associate with a javascript function, which could call a Controller method to confirm that the session is still valid, and if not, redirect to the login page using window.location.

提交回复
热议问题