mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 15:42:09 +00:00
fix(nuxt3): don't mutate options when unsetting cookie (#2481)
This commit is contained in:
parent
b5618e976b
commit
670a12caaa
@ -59,7 +59,7 @@ function readRawCookies (opts: CookieOptions = {}): Record<string, string> {
|
|||||||
|
|
||||||
function serializeCookie (name: string, value: any, opts: CookieSerializeOptions = {}) {
|
function serializeCookie (name: string, value: any, opts: CookieSerializeOptions = {}) {
|
||||||
if (value === null || value === undefined) {
|
if (value === null || value === undefined) {
|
||||||
opts.maxAge = -1
|
return serialize(name, value, { ...opts, maxAge: -1 })
|
||||||
}
|
}
|
||||||
return serialize(name, value, opts)
|
return serialize(name, value, opts)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user