Add function to get session setting and wire it up most of the way.