It seems like a two-step process to get this,
$u = $this->Auth->user();
$uid = $u['User']['id'];
Isn't there a variable set somewhere once a user is logged in? (Sorry for the dumb question.)
It seems like a two-step process to get this,
$u = $this->Auth->user();
$uid = $u['User']['id'];
Isn't there a variable set somewhere once a user is logged in? (Sorry for the dumb question.)
I think you can do $uid = $this->Auth->user('id');
- check the api: http://api.cakephp.org/class/auth-component#method-AuthComponentuser