factor session process config into a helper function