I am working in Cake 3.x and need the logged in users id. In Cake 2.x you were able to get this via the session or the AuthComponent (how dirty)
AuthComponent::user();
But now in Cake 3.x... How am I able to access the Session in a clean way to get the users id?
I've found: http://book.cakephp.org/3.0/en/development/sessions.html But it says it's easy to get the session from Controllers, Components, Views, and more...
EDIT: A very very dirty solution could be to get the $_SESSION
variable. CakePHP does not recommend this option... So, I prever another solution :)
Thank you!