implemented the basics of session management