When I’m trying to do $this->Auth->setUser($user), I’m getting error in
\cakephp\cakephp\src\Http\Session.php - Argument 1 passed to Cake\Http\Session::_overwrite() must be of the type array
protected function _overwrite(array &$old, array $new): void
Please help I can’t pass in an array as the $user is not a array
Can you provide some context? What is $user? Are you just trying to get the attributes of the logged in user? If so, and you’re using the authenticator plugin, then you just need this in your controller: