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 logoff timer does not display as expected



You are using the pxSessionTimer section and the logoff timer.  The logoff timer does not display as expected.

Error Messages

Not Applicable

Steps to Reproduce

1. Launch the Portal > New Phone Call. The section where the pxSessionTimer is embedded is in context.
2. Keep the session idle for for 2 mins to observe the warning message (OOTB) but it does not show up.
3. After 3 mins (as per the configuration) attempt to use the session. System asks for credentials (the second part is fine).

Root Cause

In Pega 7.1.7 this is a known issue when using the logoff timer. This is scheduled to be corrected in Pega 7.1.8. You can implement the same in Pega 7.1.7 as well.


To use the Logoff Timer in Pega 7.1.7 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;

        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");
    pega.openUrlInModal.showModalDialog(oSafeURL,iTime, 210, 620, function(ret){    
        if (ret == null || ret == "ok") {
        } else {
            pega.u.d.gDirtyOverride = false;
            try {
            } catch(e) {
                pega.u.d.replace('pyActivity=LogOff&pzPrimaryPageName=pyDisplayHarness', null);

3. Copy the activity ShowLogoffTimer into your application ruleset (into same ruleset where you put SessionTimer<ProjectName>).

4. Copy and rename LogoffTimer HTML rule to LogoffTimer<ProjectName> (Found in Step1 of ShowLogoffTimer)

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

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

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

        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;
            document.all('_minutes').textContent= min;
            document.all('_seconds').textContent= sec;

        iTime = iTime - 1000;

<body onload="init()">

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
          <!-- dialog header -->
          <td valign="top" class="dialogHeaderBackground" id="topBanner" height="15%"> <table border="0" cellspacing="0" cellpadding="5">
                      <!-- 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">
                            <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>
          <!-- end of dialog header -->
          <td valign="top" height="85%"><div class="dialogDataContainer" id="scrollingDIV"> 
              <!-- body of dialog -->
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <td valign="top"><table width="100%" cellpadding="0" cellspacing="0">
                        <td align="center" width="76%" CLASS="dialogSubHeaderBackground">&nbsp;</td>
                        <TD valign="top" align="center"> <TABLE border="0" CELLPADDING="0" CELLSPACING="2">
                              <TD NOWRAP="NOWRAP" class="dialogLabelStyle" align="center">    <div><pega:lookup property=".pyMessageLabel" value="Timeout will occur in" /> </div></TD>
                              <TD NOWRAP="NOWRAP" class="dialogLabelStyle" align="center"><h2><span id="_minutes"> </span>:<span id="_seconds"> </span></h2></TD>
                              <TD NOWRAP="NOWRAP" class="dialogLabelStyle" align="center"><pega:include name="LogoutTimerMessage" /></TD>

                        <TD valign="top">&nbsp;</TD>
          <!-- end of body of dialog -->
          <!-- dialog buttons -->
          <td align="center" class="dialogButtonBarContainer" id="buttonBar"> 
            <table cellpadding="0" cellspacing="0" width="100%">
                <td nowrap="nowrap" align="center">
                  <button  title='Close this window' onclick="if(typeof window.closeModal == 'function') { window.closeModal(); } else { window.close(); }"
            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> 
          <!-- end of dialog buttons -->

5. In Step1 of ShowLogoffTimer use LogoffTimer<ProjectName> HTML rule.

Placement of SessionTimer in Pega 7.1.7

If you need the new SessionTimer in the portal header, the section needs to be placed at bottom of the portal header. Drag and drop a section from "Layout" in design view and select your SessionTimer<ProjectName>. Configure parameters as required.

Published June 12, 2015 - 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