Redirect to login page after session timeout

前端 未结 4 2088
南旧
南旧 2020-12-09 22:44

I have found some similar questions but none gave me what I really need.

Here is the thing, I have added this to my web.config to handle user session ex

4条回答
  •  无人及你
    2020-12-09 23:27

    Check for expired sessions on every Page_Init event. If there are too many pages to do this check, this is what I usually do:

    • I create a base class and inherit from System.Web.UI.Page.
    • Write my redirect logic in the Page_Init event of my base class.
    • Have the rest of my pages inherit from this base class.

    Good luck.

提交回复
热议问题