Skip to main content

Support Article

DWA session locks when user exits using browser close option

SA-12392

Summary



A Direct Web Access (DWA) configuration is implemented. The email is correctly received by the external user, the expected assignment is correctly presented but the behaviour is not always the expected one.
When the external user exits the browser using close option as opposed to using provided buttons, external requestor session remains in the background locking the case and preventing any other assignments to be processed.




Error Messages



Access Denied: This request for information cannot be processed (another request is currently being processed)

Steps to Reproduce



1. Create a DWA configuration.
2. Send the first email on WorkObject1 to external user.
3. Send a second email on WorkObject2 to the same external user.
4. Click the first hyperlink to open the first assignment.
5. Instead of processing the assignment close the browser.
6. Click the second hyperlink to open the second assignment. The error is generated.

Root Cause



The issue occurs only if the external user accesses two DWA assignments in the same browser session. The reason is that the requestor ID associated with Session1 is sent to the server when the external user accesses Session2 in the same browser window. Engine denies the request of second session since the system is using the same requestor in background for different assignments (because client has sent same pega-rules cookie) and hence the behavior.

Resolution



Implement a local-change to solve this issue. The aim is to intercept the closure of the browser window (not using the Pega buttons) to logoff the requestor correctly and stop the corresponding thread.

Customize the Out-Of-The-Box section, “Work-.ActionExternal” by adding the following code:




Extracted code:


function closeAndLogOff(){
  if(!submitClicked){
   
    if(pega.env.ua.ie) {
      var strURL = document.forms[0].action;
      document.getElementById("perf_ext_activity").value="CloseAndLogOff";
      document.forms[0].submit();
         return "Proceeding to logoff";
    } else {
      $.ajax({
        type:"POST",
        async:"false",
        url : strURL,
        data : "pyActivity=CloseAndLogoff"
        });
    }
  }
}
 
pega.util.Event.addListener(window,'beforeunload',closeAndLogOff);

 
As you can see on the above code, the system calls a custom Activity called “CloseAndLogOff”.


 
On the screenshot above, the second step calls a custom version of “Code-Secuity.LogOff” Activity. A new parameter is added:


 
And the Java on step 4 has been changed:


 
Suggest Edit

Published July 28, 2015 - Updated October 8, 2020

Did you find this content helpful?

25% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

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