How to do a task only once for logged in users

There are various ways to do this, but I’ve recently addressed a similar problem by using cookies.

add_action( 'init', 'wpse_93797_cookie' ); 
function wpse_93797_cookie() {
  if ( !isset ( $_COOKIE['wpse_93797_cookie_name'] ) ) {
    // Do your stuff.

    // Set your cookie so we don't do stuff the next time around.
    // Note that 0 makes the cookie expire at the end of the user's browser session.
    setcookie( 'wpse_93797_cookie_name', 'some-value-we-did-stuff-btw', 0, "https://wordpress.stackexchange.com/" );   
  }
}

Manual for cookies on PHP.net

Also maybe helpful:

How can i set , get and destroy cookies in wordpress?