[Bug] Cookies being fetched improperly

This commit is contained in:
Sirz Benjie 2025-09-15 19:49:18 -05:00
parent 65bb58a635
commit 6ce59ecbd9
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -25,9 +25,9 @@ export function getCookie(cName: string): string {
const ca = document.cookie.split(";");
// Check all cookies in the document and see if any of them match, grabbing the first one whose value lines up
for (const c of ca) {
const cTrimmed = c.trim();
const cTrimmed = c.trimStart();
if (cTrimmed.startsWith(name)) {
return c.slice(name.length, c.length);
return c.substring(name.length, c.length);
}
}
return "";