Support Article
pxSessionTimer: Multiple modal dialogs display on timeout
Summary
SSO logoff timer is not working as per the implementation guide. User sees multiple timeout warning messages appearing in the SSO scenario.
Error Messages
No error messages
Steps to Reproduce
Login to user portal and keep the session idle for 15 minutes.
Root Cause
Placement of a pxSessionTimer is critical.
Needs to be in the portal header, pyPortalHeader section when using pyCaseManager portal for example.
Furthermore, add to the first dynamic layout as it takes no visible space.
Resolution
For Pega 7.2.2 this is similar to
https://pdn.pega.com/support-articles/pxsessiontimer-logoff-timer-does-not-display-expected
but no need to modify the ShowLogoffTimer activity and LogoffTimer HTML rules.
To use the Logoff Timer in Pega 7.2.1 or 7.2.2 follow the below steps:
1. Copy pxSessionTimer and rename to SessionTimer<ProjectName>.
2. Place the following script at the bottom of the existing <script> block just before the </script> tag.
function desktop_restartTimeoutWarningTimer(){
if (pega.desktop.TimeoutTime && pega.desktop.TimeoutTime > 0) {
var nTimeoutWarningTime= (pega.desktop.TimeoutTime - pega.desktop.TimeoutWarningWindow) * 60000;
clearTimeout(pega.desktop.TimeoutWarningCountdown);
if (nTimeoutWarningTime >= 0) {
pega.desktop.TimeoutWarningCountdown = self.setTimeout("desktop_showTimeoutLogoffDialogNew('"+pega.desktop.TimeoutWarningWindow+"')",nTimeoutWarningTime);
}
}
}
function desktop_showTimeoutLogoffDialogNew(strTime) {
var iTime = parseInt(strTime);
iTime = iTime * 60000;
var oSafeURL = new SafeURL("@baseclass.ShowLogoffTimer");
oSafeURL.put("time",iTime);
pega.openUrlInModal.showModalDialog(oSafeURL,iTime, 210, 620, function(ret){
if (ret == null || ret == "ok") {
desktop_restartTimeoutWarningTimer();
} else {
pega.u.d.gDirtyOverride = false;
try {
closeAllPRPCChildWindows();
application.logOff(true);
} catch(e) {
pega.u.d.replace('pyActivity=LogOff&pzPrimaryPageName=pyDisplayHarness', null);
}
}
});
self.setTimeout(function(){clearTimeout(pega.desktop.TimeoutWarningCountdown);}, 5000);
}
/*
Nice to have, if you have a popup window like a report that was opened via core PRPC UI actions this will close the window as part fo the logoff timeout
*/
{
var currWin = null;
var app = pega.desktop.support.getDesktopApplication();
while (null != (curWin = app.openedWindows.pop())) {
curWin.close();
}
}
Published December 5, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.