Configuring logout handling | HCL Digital Experience

When a user logs out of HCL Digital Experience, a log out from SAP NetWeaver Portal needs to be performed as well. Otherwise, the user session on the SAP NetWeaver Portal remains open until it times out.

About this task

You can configure automatic log out from SAP NetWeaver Portal when a user logs out of HCL Digital Experience. To perform this configuration, insert the following JavaScript function into your theme and call it on click of the logout link. Replace your_sap_portal_host and port with the values for your SAP NetWeaver Portal host and port.
function logoffFinalCall() {

   if (document.cookie.length>0) {
      if (isCookieExisting != -1) {
         var lnDotPos = document.domain.indexOf( "." ); 
         if(lnDotPos>=0)document.domain = document.domain.substr(lnDotPos+1);
         var logoffForm = document.createElement("form");

         var logoffParam = document.createElement("input"); = "Command";
         logoffParam.value = "LOGOFF";

         var logoffParam2 = document.createElement("input"); = "Autoclose";
         logoffParam2.value = "1000";
   //This component logs the user out of SAP NetWeaver portal.
      logoffForm.action = 
         logoffForm.method = "post"; = "_blank";
Replace the variables as follows:
Replace this variable with the name of the SSO cookie for your SAP NetWeaver Portal.
Replace this variable with the fully qualified URL to your SAP NetWeaver Portal.
Replace this variable with the port of your SAP NetWeaver Portal.