Open robksawyer opened 11 years ago
to solve that i've created a Session Variable within the beforeRender of the AppController:
if($this->Auth->loggedIn()){ $id = $this->Auth->user('id'); $logged_user = $this->User->findById($id); //knowing that i've saved all the user details i've grabbed from Facebook in the users table $this->Session->write('LoggedUser', $logged_user); }
this way you can call it from any method of any controller. of course, don't forget to do "$this->Session->destroy();" upon logout.
I'd like to be able to get a Facebook user's information within the beforeRender method and the only way I've been able to do this is using the following method. Is there a better way?