I have upgraded CakePHP from version 3.6 to 4.0, in version 3.6 i can access session in model using following workaround,
use Cake\Network\Session;
public function getSessionUser() {
$session = new Session();
return $session->read('Auth.User');
}
Now problem is that in newer version 4.0 , it is giving error "Class 'Cake\Network\Session' not found".
Can anyone help how to access session in model in cakephp 4 version ?
Thanks