I would like to use some stored cookie values in my ExpressionEngine templates without using any PHP.
My current template code
{exp:channel:entries channel="favorites" category="<?php echo $COOKIE['favorite']?>"}
{title}
{/exp:channel:entries}
This is ugly and doesn't perform that well under load. Any suggestions? Maybe an addon?
You have to set cookies in EE with the set_cookie() method in the Functions class.
$this->EE->functions->set_cookie('your_cookie_name', 'some_value', 3600 * 24) // Set a cookie that expires in 1 day
$this->EE->input->cookie('your_cookie_name'); // returns 'some_value';
EE Add-on from Devot:ee