jQuery CakePhp, , .
If you use, for example, jCookie ( https://github.com/carhartl/jquery-cookie ), the code below will work for you, replace myCompany with your cookie config name.
$.cookie.raw = true;
$.cookie('myCompany[cookie_name]', 'hallo', { expires: 365, path: '/'});
Then in your controller:
$this->Cookie->check('cookie_name')
will return true (cakephp> 2.2) and
$this->Cookie->read('cookie_name')
will return 'hallo'
When using cakephp 3.x it should look like this:
$this->Cookie->read('CakeCookie.cookie_name')
source
share