//install module
npm i --save cookie-universal-nuxt
//add module
{
modules: [
// Simple usage
'cookie-universal-nuxt',
// With options
['cookie-universal-nuxt', { alias: 'cookiz' }],
]
}
//and
//set cookie
this.$cookies.set('cookie-name', 'cookie-value', {
path: '/',
maxAge: 60 * 60 * 24 * 7
})
this.$cookies.set('cookie-name', cookieValObject, {
path: '/',
maxAge: 60 * 60 * 24 * 7
})