Skip to content

Commit

Permalink
[FE] FIX: removeCookie에 path, domain 추가 #86
Browse files Browse the repository at this point in the history
  • Loading branch information
42inshin committed Jan 8, 2024
1 parent 27736b7 commit f62e403
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/cookie/cookies.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;`;
};

0 comments on commit f62e403

Please sign in to comment.