add session handling to document repository