N
Nuxt2y ago
szobi

useCookie set bad max-age expires

Hello, i want set cookie to 30 days, my code;
const maxAge = computed(()=>60*60*24*30)// seconds * minutes * hours * day
const expires = computed(()=>new Date(Date.now() + maxAge.value * 1000 ) )// maxAges * milliseconds
const cookie = useCookie(config.public.SPONSOR_BAR_NAME,{
// expires:expires.value,
maxAge:maxAge.value
})
const maxAge = computed(()=>60*60*24*30)// seconds * minutes * hours * day
const expires = computed(()=>new Date(Date.now() + maxAge.value * 1000 ) )// maxAges * milliseconds
const cookie = useCookie(config.public.SPONSOR_BAR_NAME,{
// expires:expires.value,
maxAge:maxAge.value
})
but browser set cookie for 2023-03-30T10:55:56.877Z
expires in vuetools show : Sun Apr 23 2023 12:57:00 GMT+0200
No description
2 Replies
szobi
szobiOP2y ago
any ideas?
Patrik.S
Patrik.S2y ago
GitHub
Second variable of useCookie doesn't get set on the browser when ...
Environment Operating System: Linux Node Version: v16.14.2 Nuxt Version: 3.3.2 Nitro Version: 2.3.2 Package Manager: [email protected] Builder: vite User Config: - Runtime Modules: - Build Modules: - Repr...
Want results from more Discord servers?
Add your server