If you leave cookies on a hot baking sheet for too long, they'll continue cooking. To prevent this, let them cool slightly, then transfer to a wire cooling rack to cool completely. Alternatively, if you baked your cookies on parchment, you can always just slide the cookies and parchment off the baking sheet and let on the paper.