Ok, I've read up various posts such as CakePHP 3.x - AuthComponent::user() in View but the solution there doesn't tell you where to put that code so it will work everywhere in the application.
In CakePHP 2.x it was pretty straightforward to show things such a username in a navbar of a logged in user. The way this was done was by using the Auth component and then having something in the AppController to set a globally accessible variable with an array of the user details (first name, last name, etc).
In CakePHP 3.x I cannot see how this can be achieved.
Things such as $this->Auth->user('id'); only seem to work in Controllers.
I understand you could pass that from a Controller to a View. But what if you want it in a global template (e.g. default.ctp)? How do you do this in CakePHP 3.x? The documentation on Cake's website doesn't really tell you, because it only gives $this->Auth->user('id'); as an example.