first pass session creation and serialisation