CakeDC\Users\Auth\RememberMeAuthenticate::authenticate PHP Method

authenticate() public method

Authenticate callback Reads the stored cookie and auto login the user
public authenticate ( Cake\Network\Request $request, Response $response ) : mixed
$request Cake\Network\Request Cake request object.
$response Cake\Network\Response Cake response object.
return mixed
    public function authenticate(Request $request, Response $response)
    {
        $cookieName = Configure::read('Users.RememberMe.Cookie.name');
        $cookie = $this->_registry->Cookie->read($cookieName);
        if (empty($cookie)) {
            return false;
        }
        $this->config('fields.username', 'id');
        $user = $this->_findUser($cookie['id']);
        if ($user && !empty($cookie['user_agent']) && $request->header('User-Agent') === $cookie['user_agent']) {
            return $user;
        }
        return false;
    }
RememberMeAuthenticate