I guess the obvious question is, what have you tried?
Generally, this should be pretty easy to accomplish just by checking for the session username (isset or not also), and then just adding some php code to pull it off. However, I know this can be tricky since the problem of pathing for a website like WP does trip people up, I recommend using the full path to the file to include.
Other than that, it's trial and error.