added ability to generate session