Support Article
Problems with Javascript comments in custom pxSessionTimer
SA-8028
Summary
Users are using SSO Authentication in their application where browser timeout is set as 60 mins. Before the timeout, users should be acknowledged with a popup alert instead of challenging them with logoff screen.
desktop_restartTimeoutWarningTimer() function defined in the webwb • pega_desktop_AppControllerLite.js file is overridden in pxSessionTimer<NAME> ( Customized version of standard pxSessionTimer section rule). This section rule is included in the User top panel of the portal.
But during time, always the desktop_restartTimeoutWarningTimer() defined in the global context i.e. pega_desktop_AppControllerLite.js is being executed but not the one in customized context i.e. pxSessionTimer<NAME>.
Error Messages
NA
Steps to Reproduce
customize desktop_restartTimeoutWarningTimer() in 7.1.7
Root Cause
The root cause of this problem is a defect in customer application code/rules.
The custop pxSessionTimer rule defined a dekstop_destartTimeoutWarning() javascript function but contained a line of Javascript code with a "//" comment. The rule had the "omit extra" spaces check box enabled. At runtime the "//" comment was causing problems since it was on the same line as other parts of the javascript code. The override of desktop_restartTimeoutWarningTimer was not getting registered properly by the browser.
Resolution
This issue is resolved through the following local change.
When adding custom javascript to HTML rules do not use "//" to comment code. Instead use:
/* <Comment> */
Published January 31, 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.