michnhokn / kirby-cookie-banner

A Cookie Consent Modal for Kirby
MIT License
67 stars 9 forks source link

Cookie is not set (nginx) #3

Closed andreasotto closed 3 years ago

andreasotto commented 3 years ago

The cookie is not set.

Environment: nginx (valet+ on macOS)

The modal appears on every page load. No cookies in the browser inspector. To reproduce setup a kirby installation for example plainkit on nginx (valet+), and follow your instructions (include the snippet line just before the closing body tag). The modal dialog appears, but the cookie will not be set when clicked Accept all.

marcschneider123 commented 3 years ago

The cookie is set with the secure option in cookie-modal.js

Cookies.set(
  'cookie_status',
  features.join(','),
  {expires: 365, secure: true},
  );

So the cookie is not set on http sites. I did valet secure sitename and then it worked after visiting the site via https://.

michnhokn commented 3 years ago

@marcschneider123 Thank you for the response. I think it should be standard, because a HTTP web should not really exist anymore. However, it would be good to disable this option for the local (mostly insecure) environment.

michnhokn commented 3 years ago

@andreasotto Have a look at the new release 1.0.6