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 doesn't log the user off and close the window

SA-23923

Summary



User has a Pega application that has a limited number of user licenses, and the requirement is to use the pxSessionTimer to actually close the user's session when the timeout time has completed.
A pop-up appears after the warning period, warning the user that they are about to be logged out.

However their session window remains on the screen and on selecting 'OK' or 'Cancel' they can carry on with their work.

Here is a summary of our symptoms.

Call to ShowLogoffTimer appears to be seen by the system as a new use of the portal, so seems to extend the Requestor timeout by the amount of time set in the pxSessionTimer section.
The warning parameter seems to be the amount of time before one receives a warning, not the amount of time before the timeout when the pop-up is displayed (minor problem).

Presence of pxSessionTimer seems to supress the display of the logoff screen even if the timeout has been exceeded (or indeed the timeout specified in pxSessionTimer plus the Requestor timeout).
If pxSessionTimer is not present user gets the logoff screen, also multiple timeout pop-ups appearing upto three.


 


Error Messages



Not Applicable.


Steps to Reproduce

  1. Include pxSessionTimer in a window, for example in the CenterPanel of a Data-Portal harness.
  2. Set the warning to 5 minutes and the timeout to 10 minutes.

The pop-up appears after the 5 minutes period, but after 10 minutes Pega remains on the screen, and a Requestor is still visible in the SMA.

User has got requestor timeout, that is,  the prconfig, timeout, browser, default setting set to 9000 approximately 15 minutes for test purposes.
If user then create an access group with a portal that includes pxSessionTimer, and set the timeout parameters to ‘Timeout after = 4 minutes and Warning Window = 2 mins’  user gets the pop-up after 2 minutes.
Also the window will not get replaced with a logoff screen until the user hits ‘OK’.

If user does not have pxSessionTimer in the portal user witnesses the logoff screen.

Also seeing a phenomenon where the timer warning appears up to three times on the screen.

Root Cause



A defect in Pegasystems’ code or rules.

This is a known issue which will be fixed in Pega 7.2.1.


Resolution



Perform the following local-changes: 

First change:
The pxSessionTomer can be configured to use "Modal Dialog" or "New Window".
Use the  “New Window”.

The "Modal" window option in the pxSessionTimer ends up using the Javascript showModalDialog method. ShowModalDialog is not really cross browser compliment and it's a Microsoft Internet Explorer invention.  For example in Chrome it does implement showModalDialog and it does display new window but it is not a true modal window in all or some versions.

Second Change:
Save LogoffTimer in your ruleset and use instead the code below
This code should be preferred to the one seen in support article SA-22678 as this correspond to the solution implemented in Pega 7.2.1.



Code:


<HTML>
<Title><pega:lookup property=".pyMessageLabel" value="Log off timeout warning" /> </Title>
<pega:include name="DesktopStyles" />
<script>
var iTime;


    function init() {
        window.focus();
        window.returnValue = "ok";
        iTime = parseInt(window.dialogArguments);
        window.setTimeout("closeMe()", iTime);    
        setTime();
    }
    
    function closeMe() {
          if(arguments.length == 0){
             window.returnValue="timeout"; 
        }
        if(typeof window.closeModal == 'function') { window.closeModal(); } else { window.close(); }
    }

    function setTime() {
        var numSec = iTime / 1000;        
        numSec--;


        var min = Math.floor(numSec / 60);
        var sec = numSec % 60

        if (sec <= 9) {
            sec = "0" + sec;
        }

        if (document.all){
            document.all('_minutes').innerText = min;
            document.all('_seconds').innerText = sec;
        }
        else{
            document.all('_minutes').textContent= min;
            document.all('_seconds').textContent= sec;
         }

        iTime = iTime - 1000;
        window.setTimeout("setTime()",1000);
    }
</script>
  
<style>

      .iconDialogSetWatch {
        background-image: url(webwb/desktopimages/dialogsetwatchimage.gif);
        background-repeat: no-repeat;
        height: 57px;
        width: 56px;
          display:block;
    }
</style>

<body onload="init()">
    

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr
          <!-- dialog header -->
          <td valign="top" class="dialogHeaderBackground" id="topBanner" height="15%"> <table border="0" cellspacing="0" cellpadding="5">
              <tr
                <td><TABLE>
                    <TR> 
                      <!-- Dialog image goes here, use a style to contain the image, add to desktopbase and other style sheets -->
                      <TD valign="top" nowrap><span class="iconDialogSetWatch">&nbsp;</span></TD>
                      <TD nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
                      <TD valign="top" nowrap> <table border="0" cellpadding="2" cellspacing="0">
                          <TR> 
                            <TD NOWRAP="NOWRAP" class="dialogHeaderLabel"><pega:lookup property=".pyMessageLabel" value="Log off timeout warning" /> </TD>
                            <TD NOWRAP="NOWRAP" cLASS="dialogHeaderData"> &nbsp;</TD>
                            <td NOWRAP="NOWRAP">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            <TD NOWRAP="NOWRAP" class="dialogHeaderLabel">&nbsp;</TD>
                            <TD NOWRAP="NOWRAP" CLASS="dialogHeaderData"></TD>
                          </TR>
                        </TABLE></TD>
                    </TR>
                  </TABLE></td>
              </tr>
            </table></td>
          <!-- end of dialog header -->
        </tr>
        <tr
          <td valign="top" height="85%"><div class="dialogDataContainer" id="scrollingDIV"> 
              <!-- body of dialog -->
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr
                  <td valign="top"><table width="100%" cellpadding="0" cellspacing="0">
                      <TR> 
                        <td align="center" width="76%" CLASS="dialogSubHeaderBackground">&nbsp;</td>
                      </TR>
                      <TR> 
                        <TD valign="top" align="center"> <TABLE border="0" CELLPADDING="0" CELLSPACING="2">
                            <TR> 
                              <TD NOWRAP="NOWRAP" class="dialogLabelStyle" align="center">    <div><pega:lookup property=".pyMessageLabel" value="Timeout will occur in" /> </div></TD>
                                                          </TR>
                            <TR> 
                              <TD NOWRAP="NOWRAP" class="dialogLabelStyle" align="center"><h2><span id="_minutes"> </span>:<span id="_seconds"> </span></h2></TD>
                             </TR>
              <TR> 
                              <TD NOWRAP="NOWRAP" class="dialogLabelStyle" align="center"><pega:include name="LogoutTimerMessage" /></TD>
                             </TR>

                          </TABLE></TD>
                      </TR>
                      <TR> 
                        <TD valign="top">&nbsp;</TD>
                      </TR>
                    </TABLE></td>
                </tr>
              </table>
            </div></td>
          <!-- end of body of dialog -->
        </tr>
        <tr
          <!-- dialog buttons -->
          <td align="center" class="dialogButtonBarContainer" id="buttonBar"> 
            <table cellpadding="0" cellspacing="0" width="100%">
              <tr
                <td nowrap="nowrap" align="center">
                  <button  title='Close this window' onclick="closeMe('ok')"
            class="littleButton" id="button1" name="button1"> <span class="buttonLeft"></span> 
                  <span class="buttonMiddle"> <span class="buttonText" onmouseout="this.className='buttonText'" onmouseover="this.className='buttonTextHover'">&nbsp
                  Ok&nbsp;</span> </span> <span class="buttonRight"></span> 
                  </button></td>
              </tr>
            </table></td>
          <!-- end of dialog buttons -->
        </tr>
      </table>
</body>
</HTML>

 

Published June 6, 2016 - Updated October 8, 2020

Was this useful?

50% 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