Log out: Difference between revisions
From ASDSO Dam Safety Toolbox
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 hour ago | // Clear cookie by setting the expiration date to one hour ago | ||
const d = new Date(); | const d = new Date(); |