CakePHP - 维护用户会话
答
一般来说,你可以得到登陆用户会话:
$userIDFromSession = $this->Session->read("Auth.User.id"); //check manual for more info on sessions: http://book.cakephp.org
+1
您应该使用'$ this-> Auth-> user('id')'代替它。 – deceze
你试图跟随[文件](http://book.cakephp.org/view/1250/Authentication)?如果是这样,你卡在哪里? – deceze