convert session to dict before pickling

Session was constantly being pickled without converting to dict as it
should be.