Directing logged in users and logged out users to the right pages