fix saving empty variables in cookies