One of the possible situations is that there is a problem with the Session, causing the set-cookie returned by the server to be incorrect or missing.
As a result, the user's login information cannot be maintained.
One of the solutions is to obtain the username and password from the submission form after the user successfully logs in, and manually set them in the browser cookie.
Note that the way to obtain the password is $this->data[User][password]. If you use $this->Auth->user[password], the value may not be obtained in some cases.
If you are not switching between SSL/NONE SSL or switching between multiple application servers, this problem generally does not occur.