Cake php and using auth in layout

cakephp, cakephp-2.0

Solution

You can read Auth data from session. Something like:

$user = $session->read('Auth'); 

Don`t forget to add Session helper in your AppController.

var $helpers = array('Session');

Problem

I am using auth component and it works ok. But in my default layout before the content I have some menu which is different if user is logged in. So I want to determine if user is logged in or not - normally I use $this->Auth->user('id') but $this->Auth doesnt work in layout (it only works in view which controller is using Auth component). How to do it?

Original source