implemented basic writing and reading of sessions