fix: avoid double decoding cookie

This commit is contained in:
Pooya Parsa 2021-11-22 22:29:11 +01:00
parent ee1546be25
commit 92a03d6002

View File

@ -24,7 +24,7 @@ export function useCookie <T=string> (name: string, _opts: CookieOptions<T>): Co
const opts = { ...CookieDefaults, ..._opts }
const cookies = readRawCookies(opts)
const cookie = ref(opts.decode(cookies[name]))
const cookie = ref(cookies[name])
if (process.client) {
watch(cookie, () => { writeClientCookie(name, cookie.value, opts) })