feature/IO-2916-Remove-Beta-Switch-AIO - Remove cookie

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-09-10 13:10:49 -04:00
parent c886d874de
commit 3e1a8c87d1

View File

@@ -116,6 +116,19 @@ function Header({
const { t } = useTranslation();
export const deleteBetaCookie = () => {
const cookieExists = document.cookie.split("; ").some((row) => row.startsWith(`betaSwitchImex=`));
if (cookieExists) {
const domain = window.location.hostname.split(".").slice(-2).join(".");
document.cookie = `betaSwitchImex=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${domain}`;
console.log(`betaSwitchImex cookie deleted`);
} else {
console.log(`betaSwitchImex cookie does not exist`);
}
};
deleteBetaCookie();
const accountingChildren = [];
if (