mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-16 17:27:41 +00:00
feat: Improve cookie handling in getCookie function
This commit is contained in:
parent
93bcf8ade9
commit
cf950313fc
@ -305,6 +305,10 @@ export function removeCookie(cName: string): void {
|
||||
}
|
||||
|
||||
export function getCookie(cName: string): string {
|
||||
if (document.cookie.indexOf(cName) !== document.cookie.lastIndexOf(cName)) {
|
||||
document.cookie = `${cName}=;Secure;SameSite=Strict;Domain=${window.location.hostname};Path=/;Expires=Thu, 01 Jan 1970 00:00:00 GMT`;
|
||||
return "";
|
||||
}
|
||||
const name = `${cName}=`;
|
||||
const ca = document.cookie.split(";");
|
||||
for (let i = 0; i < ca.length; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user