Expanding on what dagon said; when you authenticate the user, you will want to store the user_id inside the $_SESSION superglobal. Session variables persist with the user from page to page.
$_SESSION['user']['user_id'] = $user_id;
$_SESSION['user']['user_name'] = $user_name;
This allows you to access the information for that user at any time.
echo "Logged in as ".$_SESSION['user']['user_name']."<br/>";