NUXT_E7011
A cookie could not be written.
E7011
useCookie() could not serialize a cookie for the Set-Cookie header or document.cookie. The original error is attached as cause. It is raised when:
- the cookie name contains characters that are not allowed in a cookie name, such as spaces,
;or= - the value returned by a custom
encodecontains characters that are not allowed in a cookie value - the attributes are inconsistent, for example
sameSite: 'none',partitioned: trueor a__Secure-/__Host-name withoutsecure: true, or a__Host-cookie with adomain - an attribute is invalid, for example a
maxAgethat is not an integer
Resolution
Use a valid cookie name, return an encoded string from encode, and set secure: true for cookies that require it:
const token = useCookie('token', {
sameSite: 'none',
secure: true,
})