We can use the login/session manager in phpbb 3 as our main sitewide login system. This way, we only have to include the php to link our files with the phpbb session manager, and not write it ourself (hours of debuging spared... trust me!)
Here is the code that should be in the file...