src/Auth/AuthUserTrait.php
public function user($key = null) {
		$user = $this->_getUser();
		if ($key === null) {
			return $user;
		}
		return Hash::get($user, $key);
	}
public function user($key = null) {
		$user = $this->_getUser();
		if ($key === null) {
			return $user;
		}
		return Hash::get($user, $key);
	}
public function user ( $ key = null ) { $ user = $ this -> _getUser ( ) ; if ( $ key === null ) { return $ user ; } return Hash :: get ( $ user , $ key ) ; }
Get the user data of the current session.

@param string|null $key Key in dot syntax.
@return mixed Data
Get the user data of the current session .