extract session into an object