Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
dnyall authored Nov 19, 2024
1 parent 9776d12 commit 96feeba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
const date = new Date();
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
document.cookie = `${name}=${value};path=/;expires=${date.toUTCString()};SameSite=Lax`;

console.log(document.cookie)
}

async function detectAndRedirect() {
Expand Down Expand Up @@ -42,7 +44,7 @@
}

// Save the language in a cookie
setCookie('userLang', lang, 365); // Save for 1 year
await setCookie('userLang', lang, 365); // Save for 1 year

// Redirect to the appropriate language
window.location.href = `/docs/${lang}/guides/`;
Expand Down

0 comments on commit 96feeba

Please sign in to comment.