js-cookie with sameSite None & secure

12.4k Views Asked by At

how do i use js-cookie with sameSite set to none & secure? is this something like this?

Cookies.set("name", "value", {SameSite : "None; secure" });

2

There are 2 best solutions below

1
On BEST ANSWER

Just do the following:

  Cookies.set('name', 'value', {
    sameSite: 'none',
    secure: true
  })
0
On

You can try simply with:

document.cookie = "witcher=Geralt; SameSite=None; Secure"

Cookie is set with above attributes: cookie