ENH setup the session correctly