Digipass S3 is now DigipassONE. This section is currently being updated to reflect our new name.

Replacing the session expiration warning

Prev Next

The App SDK's session manager provides a default UI that warns the user when their session is about to expire. If your application deploys the session manager, then NNLSessionManager displays this dialog when the session is about to expire.

To replace this warning dialog, implement the ISessionReminderUI interface.

// ISessionReminderUI implementation displays the session reminder modal
// dialog with the countdown of the remaining time.
var SampleSessionReminderUI = function() {
        this.openUI = function(remainingTime) { 
             return new Promise(function(resolve, reject) {
             // Present the reminder UI with remaining time, start countdown timer.
             // Call resolve() when the user chooses to Stay Logged In.
             // Call reject() when countdown reaches 0 or user chooses to Logout Now.
             });
        };
        this.cancel = function() {
             // Stop the timer and hide the UI.
        };
}

Then set the new warning dialog as the one the SDK should display when the session is about to expire.

SessionReminderUIFactory.setSessionReminderUI(new SampleSessionReminderUI());

Working example in Tutorial web app

  • Refer to the SampleSessionReminderUI in the file js/samples.js.