Your question is actually a good one. Lots of teens (and adults too) enjoy eating raw cookie dough and do not understand the risk of contracting Salmonella. If the cookie dough that you are consuming has raw eggs in it, than there is some risk. If you are referring to a commercial product like ice cream that contains cookie dough, you can rest assured that the eggs that are used in that dough is made safe through a process known as pasteurization.
Salmonella is a germ that can be present in foods such as raw eggs, meat, or poultry. Heating foods kills bacteria, so it is very important to cook these items fully to reduce the risk of getting infected. The time between when you eat a potentially infected item and the onset of the first symptom may be from 6 hours to 10 days, but often happens between 6 and 48 hours. Salmonella causes gastroenteritis (stomach irritation), which can include symptoms such as abdominal cramps, diarrhea, along with fever. Infants, the elderly, and people whose immune system is suppressed (such as those who are HIV+) are most at risk. Salmonella is one of the most common intestinal infections in the United States, with about 40,000 reported cases annually.
It is important to remember to cook foods completely before enjoying them, and if you experience any symptoms that are unusual contact your doctor, or if you live in northern NJ call the Adolescent/Young Adult Center For Health in Morristown, NJ at 973.971.6475.