I’m using the vue-cookie-next library to set the cookies inside my Vue 3 project. The problem is that when I try to set a cookie with a config object the cookie is not created in the browser.
That’s the function (I’m using Vue 3 Navigations guards also) I use.
function createCookies() {
const $cookie = VueCookieNext;
const access_token = "access_token_test";
const expiry_token = "expiry_token_test";
const refresh_token = "refresh_token_test";
const config = {
path: "/",
expire: 60 * 10,
domain: process.env.VUE_APP_NUXT_HOST,
secure: process.env.VUE_APP_NUXT_ENV === "production",
};
// Set cookies
$cookie.setCookie(
`project.access_token`,
access_token
);
$cookie.setCookie(
`project.expiry_token`,
expiry_token,
config
);
$cookie.setCookie(
`project.refresh_token`,
refresh_token
);
}
The access_token and refresh_token cookie are created in the browser but the expiry_token is not created in the browser