Used to serialized the bean of type T into string so that it can be saved into the session variable.
serialized string