如何在模型中包含Session组件? CakePHP的

I really need to use $this->Session->read('id') in one of the model's method therefore I need to include Session component in the model. How can I do that? public $component = array('Session'); doesn't work like in the Controller.

the component should be and is limited to the controller.

but you can use the static access:

CakeSession::read('Auth.User.id')

etc

For using session inside the custom component I tried with

public $components = array('Session');

and then called it by using

$this->Session->read('Auth.User.id');