Cakephp doesn't write a cookie

Posted by radious on Stack Overflow See other posts from Stack Overflow or by radious
Published on 2010-05-10T23:51:56Z Indexed on 2010/05/10 23:54 UTC
Read the original article Hit count: 380

Filed under:
|
|
|

Hello! I have a problem with writing cookies in cakephp and even don't know how to debug it or where too look for a clue.

I've inherited a project where cookie were only created using the Session component, of course i added 'Cookie' to $components array in app_controller and put this in beforeFilter:

$this->Cookie->name = 'foo';
$this->Cookie->path = '/home/~nick'; 
$this->Cookie->domain = 'hostname';   
$this->Cookie->secure = false;  //i.e. only sent if using secure HTTPS
$this->Cookie->key = 'some key';

and in some action i use:

$this->Cookie->write('key', 'value');

I access page by http://hostname/home/~nick/foo and actually try to put even something so silly. I doesn't work. I would be really gratefully for any clue where to search problem. Thanks!

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about cookie