How do you know if cookies are undercooked?
Cookies are a kind of an informal treat. Tastes vary on the degree of done-ness that is best. 

If your cookies won't hold together well enough to take them off the baking sheet with a spatula, or if parts of them are obviously still very gooey/runny, then they are undercooked. Otherwise, the best way to tell is to sample one (after it has cooled enough to eat). If you feel it is undercooked, then leave the next batch in a little longer. 

Some people like their cookies "rare" (still a little soft and moist in the middle), and others prefer them well browned and fully cooked until they are firm all the way through. It's an individual judgement with no officially correct standard.