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 32: Line 32:
     <p><strong>You are now logged out.</strong></p>
     <p><strong>You are now logged out.</strong></p>
     <p>Note that some pages may continue to be displayed as if you are still logged in, until you clear your browser cache.</p>
     <p>Note that some pages may continue to be displayed as if you are still logged in, until you clear your browser cache.</p>
     <p>Return to <a href="">Page Name</a></p>
     <p>Return to <a id="redirectUrl" href="/wiki/Main_Page">Main Page</a></p>
   </div>
   </div>


   <script>
   <script>
     function setCookie(cname, cvalue, exdays) {
     function onLoad(){
       const d = new Date();
       const urlParams = new URL(window.location.toLocaleString()).searchParams;
      d.setTime(d.getTime() + (exdays*24*60*60*1000));
       const redirectUrl = urlParams.get('redirectUrl');
       let expires = "expires="+ d.toUTCString();
       console.log(redirectUrl);
      document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
       document.getElementById("redirectUrl").href = redirectUrl;
       console.log('Set Cookie');
      document.getElementById("redirectUrl").text = redirectUrl;
       console.log(cname + "=" + cvalue + ";" + expires + ";path=/");
     }
     }


     function logOut() {
     function logOut() {
       // Clear cookie by setting the expiration date to one hour ago
       // Clear cookie by setting the expiration date to one hour ago
       console.log('Clear cookie');
       const d = new Date();
       //document.cookie = "remoteUserEmail=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
      d.setTime(d.getTime()-3600);
      setCookie('remoteUserEmail', '', -1);
       document.cookie = "remoteUserEmail=; expires="+ d.toUTCString() + "; path=/;";


       // Navigate to Impexium site and logout there
       // Navigate to Impexium site and logout there
       //console.log('Navigate to Impexium site and logout there');
       setTimeout(function() {
      // Simulate a mouse click:
        window.location.href = 'https://asdso.mpxstage.com/account/logout.aspx';
      //window.location.href = 'https://asdso.mpxstage.com/account/logout.aspx';
       }, 3000);
       // Simulate an HTTP redirect:
      //window.location.replace('https://asdso.mpxstage.com/account/logout.aspx');
 


       // Show confirmation
       // Show confirmation

Revision as of 20:02, 17 April 2023

Do you want to log out?