full session logic implemented