During the fourth month of pregnancy, the eccrine sweat glands start to form. When a baby is born, the eccrine glands on their foreheads are the most active ones. As a result, newborns start sweating in these locations.