If the end goal is to get information regarding the currently logged in user, you should simply use the below core utility function to grab the current User object with all the info you could need.
$user = JFactory::getUser();
echo $user->username;
echo $user->id;
echo $user->email;
// and so on