Well, right off the bat, I see no session_start()...however, I'll assume that session_start is called from the included config.php file or sessions are turned on automatically in your php.ini, htaccess file, or apache config. If my assumption is wrong, that is definitely the problem. Since the if block failing is
if(isset($_SESSION['logged_in']))
and you're sure $_SESSION['logged_in'] is being set (and my assumption was correct), make sure your browser accepts cookies, and if you like it not accepting cookies, php (I believe it's the default) can append the session id to the URL. For troubleshooting purposes, you can install an HTML header viewer such as livehttpheaders for Firefox. Or ieHTTPHeaders for Internet Explorer. Check for the session id as a cookie in the response header. If it is not being passed, you may need to modify your configuration. For example, someone in this forum had their sessions being written (or not being written) to an unwritable folder. Good luck!