Close popover
Paige Robinson (PaigeR11)
United Health Group
Paige Robinson
United Health Group
PaigeR11 Member since 2014 7 posts
United Health Group
Posted: March 7, 2018
Last activity: March 7, 2018

Browser/Tab close for logoff event

We have a requirement to capture logoff on browser or tab close.

The client cannot enforce using the logoff feature.

We created TabCloseEventDetection(displayed below) which displayed a pop up box to the user when the tab or browser was closed. The User selects "OK" at which point they are logged off and the event recorded in the database.

The issue we are facing is upon auto logoff. When Pega auto logs out the Java script is also detected. The pop up box is displayed to process the logoff but because the user is not available to select, the logoff event is not completed.

Has anyone faced a similar requirement and what was the solution?

window.addEventListener("beforeunload", function (e) {
var confirmationMessage = "o/";
var p = (e || window.event).returnValue == confirmationMessage;
/  if(true){
//pega.u.d.replace('pyActivity=LogOff&pzPrimaryPageName=pyDisplayHarness', null);
alert("You will be Logged off");
var oSafeUrl = new SafeURL("@baseclass.LogOff");
var request = pega.u.d.asyncRequest('GET',oSafeUrl);
//, null,[]);

/  alert("Refresh");


Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.