Automatically redirect to login screen when session expires

3 posts, 0 answers
  1. Michael
    Michael avatar
    21 posts
    Member since:
    Aug 2008

    Posted 01 Oct Link to this post

    What is a good approach to prompting the user 1 minute before the ASP.NET session expires, and then automatically redirecting the user to the login screen?  Does anyone have a code example? 

     

     

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 04 Oct Link to this post

    Hi Michael,

    The followign demo shows one approach you can take: http://demos.telerik.com/aspnet-ajax/notification/examples/sessiontimeout/defaultcs.aspx. The demo description section explains the core functionality and can help you get it easily into you project without the eye candy of the demo, as most of the code you will see there relates to timers and UX. The key thing is to:

    • update the notification when the session is renewed (usually by adding the update panel)
    • set the ShowInterval of the notification to make it pop-up a bit before the session expires.

    You can, of course, do this with simple setTimeout or setInterval calls without RadNotification and its events.

    Regards,

    Marin Bratanov
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Michael
    Michael avatar
    21 posts
    Member since:
    Aug 2008

    Posted 04 Oct in reply to Marin Bratanov Link to this post

    Super helpful.  Thank you!
Back to Top