'Sanctuary cities' promise legal fight after Sessions threatens funds