implement session var expansion