Wash, dry, and thinly slice the cucumbers. Peel and slice the onions. Mix the two ingredients together in a bowl and sprinkle with the salt. Leave 2 hours. Rinse and drain. Bring the vinegar, sugar, and spices to a boil and simmer for 3 minutes. Pack the drained cucumbers and onions loosely in warm jars. Cover with the spiced vinegar and seal immediately.