js-cookie icon indicating copy to clipboard operation
js-cookie copied to clipboard

After deleting cookie somehow it's coming again

Open purushothaman-source opened this issue 4 years ago • 7 comments

Cookies.remove("session", {
          sameSite: "strict"
        });

I used this above statement to remoe the cookie ..but somehow it came back again

purushothaman-source avatar Nov 19 '22 11:11 purushothaman-source

When and how exactly do you see the cookie and you expect it to no longer exist?

carhartl avatar Nov 19 '22 17:11 carhartl

How did you set the cookie?

carhartl avatar Nov 19 '22 17:11 carhartl

Cannot reproduce, lacking additional information.

carhartl avatar Nov 21 '22 17:11 carhartl

How did you set the cookie?

also has the same issue but i set cookie in test.domain.com i use it in app.domain.com and i removed it from app.domain.com but it still there

Mifayo avatar Nov 28 '22 14:11 Mifayo

@Mifayo Unless you have set the cookie with the domain .domain.com you cannot delete it across subdomains.

carhartl avatar Nov 28 '22 16:11 carhartl

@Mifayo Unless you have set the cookie with the domain .domain.com you cannot delete it across subdomains.

@carhartl I used this document.cookie = "key=;domain=.domain.com;max-age=0"; instead of Cookies.remove

Mifayo avatar Nov 29 '22 12:11 Mifayo

It was solved ..My bad .. From backend they setting cookie through response -header ..

purushothaman-source avatar Nov 30 '22 05:11 purushothaman-source