From either a plugin or a Twig template, is there a prescribed way to set (and get) cookies?
I've seen https://github.com/lewisjenkins/craft-lj-cookies/, which just uses PHP's setcookie
.
Also noticed getCookie
in craft.request
. https://craftcms.com/docs/templating/craft.request#getCookie
I've noticed the cookies set with setcookie
aren't readable by getCookie
. How should one set a cookie so that it is readable by getCookie
?