How do you set the cookie domain?

I've setup a hosts entry for local development for app.local Now I'm running nuxt with nuxt dev --host app.local The problem is that when I use setCookie from h3 its still creating the cookie for the localhost domain. Is there a way to change this?
2 Replies
Sam  K
Sam K7mo ago
hey @Ryan the Temp did you try setCookie from h3?
setCookie(event, cookieName, cookieValue, {
domain: 'your-domain,
secure: true,
sameSite: 'strict',
path: '/,
maxAge: parseInt(_cookie['Max-Age']),
httpOnly: true,
expires: new Date(_cookie.expires)
});
}
setCookie(event, cookieName, cookieValue, {
domain: 'your-domain,
secure: true,
sameSite: 'strict',
path: '/,
maxAge: parseInt(_cookie['Max-Age']),
httpOnly: true,
expires: new Date(_cookie.expires)
});
}
Ryan The Temp
Ryan The TempOP6mo ago
thanks will try that
Want results from more Discord servers?
Add your server