Support Article
Session Timeout - All windows are not closed
SA-26288
Summary
When multiple peripheral windows are opened by a session, on session timeout the main session window closes according to expectations, but peripheral windows (such as reports opened in pop-up windows) do not close automatically.
Error Messages
Not Applicable
Steps to Reproduce
- Open portal, which embedded pxsessionTimer section.
- Run any report, which opens the pop-up window.
- Configure a button to open harness as pop-up window.
Root Cause
PRPC does not close all child windows by default during log off.
Resolution
The PRPC User Interface layer tracks child windows. Perform the following local-change:
Use the JavaScript function given below to close all child windows when called:
function closeAllPRPCChildWindows()
{
var currWin = null;
var app = pega.desktop.support.getDesktopApplication();
while (null != (curWin = app.openedWindows.pop()))
{
curWin.close();
}
}
Note: This code does requires a complete PRPC portal. This will not work with an Internet Application Composer implementation that displays a harness for example.
To include in logoff session timer code:
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);
}
function closeAllPRPCChildWindows()
{
var currWin = null;
var app = pega.desktop.support.getDesktopApplication();
while (null != (curWin = app.openedWindows.pop())) {
curWin.close();
}
}
Published August 5, 2016 - 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.