export function setCookie(name: string, value: string, expires: number) { const d = new Date(); d.setTime(d.getTime() + expires); const expires_at = "expires="+ d.toUTCString(); document.cookie = name + "=" + value + ";" + expires_at + ";path=/"; } export function getCookie(name: string): string { const name_with_equals = name + "="; const decodedCookie = decodeURIComponent(document.cookie); const ca = decodedCookie.split(';'); for(let i = 0; i