Can't access cookie, returning undefined

I am trying to access a cookie but its returning undefined for the value, and cant find the Issue. My code looks pretty simple so far:
const token = useCookie('token');
console.log('token', token.value)
const token = useCookie('token');
console.log('token', token.value)
token undefined, app.vue:4
When looking into dev tools of my browser, the cookie is set and not expired - does anyone has a idea what's the issue here?
No description
3 Replies
warflash
warflash2y ago
Can you provide a reproduction? just tried this in a new project and as soon as the cookie has been set once it shows up in the log as expected
Cake
Cake2y ago
can u even access httponly cookies in javascript?
UnRunDead
UnRunDeadOP2y ago
Oh wow, thats it...... Thanks @Cake, was because of the http only, I am a noob in cookies - so I thought it means its to allow the usage on http sites without certs, seems like it isn't :Yep: I removed the flag, and now its accessible
Want results from more Discord servers?
Add your server