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

Session time out notifcation

1 Answer 447 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pallavi
Top achievements
Rank 1
Pallavi asked on 13 Jul 2017, 01:57 PM

Hi Team,

I wanted to shown an modal pop up message to user when  the screen is inactive for 20 minutes.
if the user clicks yes his session will increase by 20 minutes again and  continue.if clicked no he is moved to logout screen.I wanted to do this through kendoUI modal popup. any code snippet you share on this will be great to start off.

I have done this through Jquery  library (jquery.idle-timer.js) but has lot off UI issues.

It will be great to start of if you have any code which can solve my issue here 

Thanks Again!

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 17 Jul 2017, 08:06 AM
Hi Pallavi,

To detect inactivity of the user in the browser window, you could use one of the suggested approaches in the following StackOverflow threads:

- Detecting idle time in JavaScript elegantly;

- Detecting user inactivity over a browser - purely through javascript;

​- How to know browser idle time?

If you detect an inactivity of 20 minutes using one of the above approaches, you could prompt the user to stay in the session or not, using the predefined Kendo Confirm Dialog:
kendo.confirm("Do you want to continue your session?").then(function () {
    // This will be executed if the OK button is pressed
    kendo.alert("You chose to continue the session.");
}, function () {
    // This will be executed if the Cancel button is clicked
    kendo.alert("You chose to terminate the session.");
});

I hope, that this helps. In case you have any other questions, please do not hesitate to contact us.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Pallavi
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or