ver: cake 2.4.2
・変数のセット
Controller/AppController.php
public function beforeFilter() { // add for login check $this->set( 'loggedIn', $this->Auth->loggedIn() ); }
例:ヘッダーで判定
if ($loggedIn) { echo ''. $this->Html->link(__('Logout'), array('controller' => 'users', 'action' => 'logout')) . "
"; } else { echo ''. $this->Html->link(__('Login'), array('controller' => 'users', 'action' => 'login')) . "
" }