title: CakePHP 3.6 - Get Cookie from other controller
body: <p>I followed this and set it up in my <code>AppController.php</code> since the cookie should be created from wherever the user first hits the entire website:</p>
  
  <pre><code>use Cake\Http\Cookie\Cookie;
  use Cake\Http\Cookie\CookieCollection;
  
  class AppController extends Controller
  {
  
      public function initialize()
      {
          parent::initialize();
  
          .....
  
          $cart_cookie = (new Cookie('cart'))
              -&gt;withValue([])
              -&gt;withExpiry(new \DateTime('+1 year'));
  
          $cookies = new CookieCollection([$cart_cookie]);
      }
  }
  </code></pre>
  
  <p>Now how can I access this cookie in say CartController.php so I can modify its value?  I tried accessing <code>$this-&gt;cookies</code> or <code>$cookies</code> but it says it doesn't exist.  Maybe I missed something in the CakePHP book, but I'm not finding a solution or example.</p>