Database correctly updates a user's logged_in status when logging in and out