Here is a nice example I came up with.
<?php if (is_user_logged_in()){
global $current_user; get_currentuserinfo();
echo('Welcome, ' . $current_user->user_firstname . ' | ');
}
else {
echo "Welcome, Visitor | ";
};
?>
The user_firstname
can be changed to a number of things. See: Function_Reference/wp_get_current_user