title: Cakephp doesn't write a cookie
body: <p>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.</p>
  
  <p>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:</p>
  
  <pre><code>$this-&gt;Cookie-&gt;name = 'foo';
  $this-&gt;Cookie-&gt;path = '/home/~nick'; 
  $this-&gt;Cookie-&gt;domain = 'hostname';   
  $this-&gt;Cookie-&gt;secure = false;  //i.e. only sent if using secure HTTPS
  $this-&gt;Cookie-&gt;key = 'some key';
  </code></pre>
  
  <p>and in some action i use:</p>
  
  <pre><code>$this-&gt;Cookie-&gt;write('key', 'value');
  </code></pre>
  
  <p>I access page by <a href="http://hostname/home/~nick/foo" rel="nofollow noreferrer">http://hostname/home/~nick/foo</a> 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!</p>