Reputation: 9
It is tricky for me since I'm a newbie to cakephp.
So, the problem:
I have a cookie called "userClick" which I store through jQuery. But I need to read it in some cases in cakephp. The problem now is that cakephp doesn't recognize it.
If I use $_COOKIE it works fine but with var_dump( $this->Cookie->read('userClick'))
I get an empty array, is there something to do?
Upvotes: 0
Views: 163
Reputation: 2051
Try adding 'Cookie' to your components (in the controller class, a parameter should be named components):
var $components = array('Cookie');
See here: http://book.cakephp.org/1.3/en/The-Manual/Core-Components/Cookies.html
Upvotes: 1