diff --git a/packages/nuxt3/src/app/composables/cookie.ts b/packages/nuxt3/src/app/composables/cookie.ts index 1a6602cce1..99ce33c0be 100644 --- a/packages/nuxt3/src/app/composables/cookie.ts +++ b/packages/nuxt3/src/app/composables/cookie.ts @@ -59,7 +59,7 @@ function readRawCookies (opts: CookieOptions = {}): Record { function serializeCookie (name: string, value: any, opts: CookieSerializeOptions = {}) { if (value === null || value === undefined) { - opts.maxAge = -1 + return serialize(name, value, { ...opts, maxAge: -1 }) } return serialize(name, value, opts) }