improved session to allow control of session Ids for testing