Is it OK to eat undercooked cookies?
Undercooked cookies are still edible, don't toss them! Some people prefer chocolate chip cookies underdone, but you can't know for sure that the egg has fully cooked (although that wouldn't bother me one bit unless the source was shaky).
How do you know if cookies are undercooked?
Doing a Physical Check. Press the edges with your finger. Open up the oven, pull out the rack a bit, and push the sides of the cookie very lightly with a spatula or your finger. If the edge stays firm and doesn't fall inwards, then your cookies are done.