Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

pxSessionTimer: Multiple modal dialogs display on timeout

SA-43337

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
*/

function closeAllPRPCChildWindows()
{
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

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us