Implemented serialization of session data.