Set cookie in Prestashop

For set cookie in Prestashop in Module

$cookie = Context::getContext()->cookie;
$cookie->cookieVarName = 'cookieValue';

and You can access this via

$cookie = Context::getContext()->cookie;
echo $cookie->cookieVarName;

Advertisements