This is a migrated thread and some comments may be shown as answers.

Automatically redirect to login screen when session expires

2 Answers 105 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 01 Oct 2016, 08:48 PM
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 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 04 Oct 2016, 08:42 AM

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.
0
Michael
Top achievements
Rank 1
answered on 05 Oct 2016, 03:33 AM
Super helpful.  Thank you!
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Michael
Top achievements
Rank 1
Share this question
or