ASDSO Dam Safety Toolbox

Log out: Difference between revisions

From ASDSO Dam Safety Toolbox
Jump to: navigation, search
No edit summary
No edit summary
Line 46: Line 46:
       }
       }
     }
     }
function getCookie(cname) {
  let name = cname + "=";
  let ca = document.cookie.split(';');
  for(let i = 0; i < ca.length; i++) {
    let c = ca[i];
    while (c.charAt(0) == ' ') {
      c = c.substring(1);
    }
    if (c.indexOf(name) == 0) {
      return c.substring(name.length, c.length);
    }
  }
  return "";
}


     function logOut() {
     function logOut() {
console.log(getCookie('remoteUserEmail'));
       // Clear cookie by setting the expiration date to one day ago
       // Clear cookie by setting the expiration date to one hour ago
       var cookieName = 'remoteUserEmail';
       const d = new Date();
      var cookieValue = '';
       d.setTime(d.getTime()-3600);
      var myDate = new Date();
       console.log(d.toUTCString());
       myDate.setDate(myDate.getDate()-1);
       document.cookie = cookieName +"=" + cookieValue + ";expires=" + myDate + ";domain=damtoolbox.org;path=/";


      document.cookie = "remoteUserEmail=; expires="+ d.toUTCString() + "; path=/;";


       // Navigate to Impexium site and logout there
       // Navigate to Impexium site and logout there
       setTimeout(function() {
       setTimeout(function() {
         //window.location.href = 'https://asdso.mpxstage.com/account/logout.aspx';
         window.location.href = 'https://asdso.mpxstage.com/account/logout.aspx';
       }, 3000);
       }, 3000);



Revision as of 21:07, 17 April 2023

Do you want to log out?