vue-cookies
vue-cookies copied to clipboard
Vue cokies does not work inside an iframe
I'm working on some legacy code one of my ex-colleague left me.
Inside a router guard, he added this check.
window.$cookies.get("token-iotbuilding")
He manually sets the cookie after he calls the authentication API.
globalLogin.$cookies.set("token-iotbuilding", response.data.user.user.token);
But when I put the entire app inside an iframe the $cookies.get
always returns null
Am I doing something wrong? I never had this issue when putting a web app inside an Iframe;
I tried to set the same site to Lax
too but it's just not working at all
globalLogin.$cookies.set("token-iotbuilding", response.data.user.user.token, null, null, null, null, "Lax");
Facing the exact same problem. Unable to set a cookie when Vue app loads inside of an iframe.
Use samesite = none and secure = true