Authentication end of sessions

Hi everyone,
I’ve implemented an authentication system (based on the official tutorial) with authorization and policy.
Everything is right, but when the session end, without login, the framework generates an error without doing a redirect to the login page.

Have you any suggestions to manage it?


Maybe is better to use CakeDC/Users?

At the very least, we’d need to know what error is generated.

Now I’ve switched to CakeDC/Users plugin and everything is right. But, I’m using the AdminLTE plugin for creating an admin panel. I want to create a custom login page based on AdminLTE. How can I force the layout for another plugin (Users).

Generally, I use $this->viewBuilder()->setLayout('AdminLTE.login'); but in this case, I don’t have the controller to put this method and the Users Controller are into the vendor directory.

If I put the setLayout method into AppController it works, but after login the page show me a lot of red alert, and I don’t understand why.

Someone have any idea to fix this?

Best regards

When you ask an entirely unrelated question, you’ll typically get better results if you do it as a new question, not tacked onto the end of an unrelated question. Also helps future users find answers when they have similar issues.

But what you want here is presumably to add a listener for one of the controller events.