[Solved][3.5]400/500 Errors Causes a Logout of an Authenticated User in debug mode false


How to configure CakePHP 3.5 to tell him not to disconnect users in case of 404,500 error, … because every time i get a 404 the user is disconnected from the application.


Can you elaborate on what you mean by “disconnected”? Do you have some sort of persistent connection going on, or do you mean that they get logged out, or something else?

Looking by the title of the topic, I think he means logged out.

Yes that’s it : a logged user (with Auth component) get disconnected if he get a 400 error and i don’t want this behavior.

Is it possible to tell CakePHP 3.5 to leave connected an authenticated user even if he has a 400 error ?

This problem doesn’t appear in debug mode true.


I’ve never experienced this. Errors, by default, don’t cause sessions to be removed or cookies to be deleted. Do you have a custom error handler in place that might be misbehaving?

I get this errors from time to time. I believe its because error controller doesn’t load AuthComponent by default, but I didn’t really investigate it.

Finally found the problem, it was a problem of loading the Auth component, i don’t know why but everything works now

Thanks everyone for the help

Did you initiaze it in the errorcontroller or where ?