further work on session handler. (wip)