set up session handling