CakePHP通知(8):未定义的属性:View :: $ Cookie [CORE / Cake / View / View.php,804行]

Notice (8): Undefined property: View::$Cookie [CORE/Cake/View/View.php, line 804]

I use if ($this->Cookie->read('userId') != null) in AppController and it gives me error above. Why?

You may need to add this to the controller:

var $components = array('Cookie');

It's because you're using the Cookie component in the CTP file