TyMaszWeb / django-cookie-law

Helps your Django project comply with the EU cookie regulations by displaying a cookie information banner until it is dismissed by the user
BSD 2-Clause "Simplified" License
140 stars 69 forks source link

Cookie “cookielaw_accepted” will be soon rejected #68

Closed Andresmena99 closed 2 years ago

Andresmena99 commented 3 years ago

I am getting the following warning message when using Firefox:

Cookie “cookielaw_accepted” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

The error is apparently in this line in the JavaScript code:

document.cookie = name + "=" + value + expires + "; path=/";

Thanks in advance.

2021-03-13_12-25

Andresmena99 commented 3 years ago

Update

This issue can be solved by simply changing the way the cookie is set, with the following line:

document.cookie = name + "=" + value + expires + ";path=/; Secure;";

piotrkilczuk commented 3 years ago

Would you mind opening a Pull Request @Andresmena99 ?

I'm not using this project currently, so I won't be able to verify it's working properly...