diff --git a/.changeset/smart-seahorses-heal.md b/.changeset/smart-seahorses-heal.md new file mode 100644 index 0000000000..9a402a0246 --- /dev/null +++ b/.changeset/smart-seahorses-heal.md @@ -0,0 +1,5 @@ +--- +"@wagmi/core": patch +--- + +Fixed built-in cookie storage `removeItem` working for all paths. diff --git a/packages/core/src/utils/cookie.ts b/packages/core/src/utils/cookie.ts index 06814c3347..ccd07bc7b7 100644 --- a/packages/core/src/utils/cookie.ts +++ b/packages/core/src/utils/cookie.ts @@ -10,11 +10,11 @@ export const cookieStorage = { }, setItem(key, value) { if (typeof window === 'undefined') return - document.cookie = `${key}=${value};Path=/;SameSite=Lax` + document.cookie = `${key}=${value};path=/;samesite=Lax` }, removeItem(key) { if (typeof window === 'undefined') return - document.cookie = `${key}=;max-age=-1` + document.cookie = `${key}=;max-age=-1;path=/` }, } satisfies BaseStorage