pickle session object, fix bugs