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

Mashup: pyDeleteDocumentPg call after issuing a logoff



Two gadgets are exposed to an external .NET application using IAC.
Reverse proxy is implemented using IIS.
No Pega Gateway

When the user either logs off from the external application or session timeout on external application, there is a call to pyDeleteDocumentPg after the logoff. The application is trying to generate another Pega session by creating a new Pega-RULES cookie immediately after the logoff is issued, this is creating troubles and until this newly created session is either killed using SMA or passive ID.

Error Messages

Call stack looks as follows:



Sometimes, log says, no failure stream set by custom authentication activity.

Steps to Reproduce

Implement IAC and issue a logoff from IAC.

Root Cause

The gadget is just displaying harnesses from either Display or CreateNewWork actions. The logoff is being sent from the top level application and then the IAC gadget iframe is getting unloaded as the top level application navigates to it's logoff page. The harness level onbeforeUnload event is being triggered and calling pyDeleteDocumentPg.


The solution is to have the top level application remove the listener for the harness level onbeforeunload event.

PRPC Changes:

Add the following Javascript function to UserWorkForm:

function setUIForPRPCLogoff(){

pega.util.Event.removeListener(window, "beforeunload",pega.u.d.harnessOnBeforeUnload);

Top Level App Changes:

The following is from an internal sample application.

function testLogOut(){
/* top level logout can now occur */
document.location.href = "Logout.html";


function logOffPRPC() {

/*Find PRPC iFrame element which will be PegaGadget parameter plus "ifr" */
var prpcWindow = document.getElementById("[Gadget]ifr").contentWindow;
if (prpcWindow != null)
if (typeof prpcWindow.setUIForPRPCLogoff === "function") {
/* Call PRPC logoff */
var logoffURL = pega.web.config.gatewayURL+pega.web.config.systemID+"/!"+pega.web.config.appName
xmlhttp=new XMLHttpRequest();"GET",logoffURL,false);

Published March 11, 2017 - Updated October 8, 2020

Was this useful?

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