From f62e40314f8538873e53b48ad71fc573ee5a3c3e Mon Sep 17 00:00:00 2001 From: 42inshin Date: Mon, 8 Jan 2024 12:52:25 +0900 Subject: [PATCH] =?UTF-8?q?[FE]=20FIX:=20removeCookie=EC=97=90=20path,=20d?= =?UTF-8?q?omain=20=EC=B6=94=EA=B0=80=20#86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/cookie/cookies.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/cookie/cookies.ts b/src/api/cookie/cookies.ts index bcf2725..cbff8a4 100644 --- a/src/api/cookie/cookies.ts +++ b/src/api/cookie/cookies.ts @@ -1,4 +1,5 @@ const tokenName = import.meta.env.VITE_TOKEN; +const domain = new URL(window.location.origin).hostname; export const getCookie = () => { return document.cookie @@ -10,5 +11,5 @@ export const getCookie = () => { }; export const removeCookie = (): void => { - document.cookie = `${tokenName}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`; + document.cookie = `${tokenName}=; path=/; domain=${domain}; expires=Thu, 01 Jan 1970 00:00:01 GMT;`; };