The Republican-controlled state senate passed the measure by just four votes late Friday. Governor Andrew Cuomo signed it immediately.