Hi @yvesroma190,
As you’ve said you’re using CakePHP 3.8, I’m assuming you are using AuthComponent to handle authentication. You can get logged in user’s data via $this->Auth->user('name');. It will return only data that you’ve set while logging user in $this->Auth->setUser($user).
I suggest you give https://book.cakephp.org/3/en/controllers/components/authentication.html link a read from where you can get reference.