Supported both serialize() and session_encode()