Cookie path does not work

Asked

Viewed 32 times

1

I create a cookie with javascript, until then beauty, but when I use the path it simply stops working, so it works:

document.cookie="gravado=sim";

the problem is that this way I can’t access it by other pages, it only exists on the page in question, so I tried to do this:

document.cookie="gravado=sim; path=/";

but that way it just stops working, not even on the page where it’s created it works

  • And just like that! I tested your example here and it worked

  • I don’t know why this is going wrong with me, I’ve tried Chrome, firefox, opera, and none of them worked, only works without the path

  • ta showing no error in console no?

  • Here tb worked normal. Which environment you are using: local machine without server, local machine with server or remote server?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.