fix cookie saving [object, object] issue