implemented functions to directly read/write serializable data from/to sessions (see issue #15)