first complete implementation of session class