Let's have a $_SESSION[ 'user' ] key with all the user information inside. It should only be defined if the current user is logged in. i.e. we should have $_SESSION[ 'user' ][ 'id' ], $_SESSION[ 'user' ][ 'name' ] etc. This is so that session variables can be used for other purposes as well.