vue-cookies icon indicating copy to clipboard operation
vue-cookies copied to clipboard

Vue cokies does not work inside an iframe

Open mxswat opened this issue 4 years ago • 1 comments

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");

mxswat avatar Sep 21 '20 17:09 mxswat

Facing the exact same problem. Unable to set a cookie when Vue app loads inside of an iframe.

a21y avatar Jan 03 '21 12:01 a21y

Use samesite = none and secure = true

maelkermann avatar Oct 10 '22 13:10 maelkermann