Open leonardogruppelli opened 3 years ago
I am also experiencing this. Any fix?
I am also experiencing this. Any fix?
I got it working with this in my main.js
import { globalCookiesConfig } from "vue3-cookies";
globalCookiesConfig({
expireTimes: "30d",
secure: true,
sameSite: "Strict",
});
I am still facing this issue today.
fixed by using vanilla js
document.cookie = `token=${token}; expires=${expires}; path=/`;
I got it working with this in my main.js
import { globalCookiesConfig } from "vue3-cookies"; globalCookiesConfig({ expireTimes: "30d", secure: true, sameSite: "Strict", });
This works for me when using localhost:8080:
These scenarios in global config result in "session" cookie only for me, ignoring expiry time (e.g. 30d as above):
path: "/"
path: "<something arbitrary>"
domain: "localhost"
domain: "<something arbitrary>"
These scenarios result in expected behaviour, as long as I omit path:
entry
domain: ""
domain:
Other notes
domain: ""
, but I can't replicate. Publishing to my github page https://sidawg.github.io/Vuetar/ (first line = config scenario, bullets = reported in browser cookie info). I'm about 90% sure below is captured correctly :D Note i also have 'sameSite: "None"' (and secure = true)
Path omitted and (domain omitted or domain = "")
Path omitted and domain as sidawg.github.io
(Path = "/Vuetar" or Path = "/") and (domain = "" or domain = "sidawg.github.io" or domain omitted)
So localhost and Github pages behaviour consistent. I think conclusions something like:
I've followed the documentation to configure the package on my Vite project.
This is my
main.js
file, usingglobalCookiesConfig
.Even though
expireTimes
is being set in the global configuration, all cookies are being created with the expiration set toSession
.