dxpy: make session handler configurable