I am currently modifying an existing CakePhp project and I would like to set a cookie on a specific project page (it has a .ctp file), so first I tried to put the setcookie php code at the beginning of the .ctp template (before the doctype tag, as I did would be on a regular php website), but it does not work, cookie is not set.
So my question is: how can I add a cookie to the visitor when I get to page X (which its template file is called list.ctp (for example)) on the website?
Thanks everyone!
source
share