As with most cookies, the secret to ensuring that they do not spread is to bake them when they are cold. This sets the butter inside of the cookie meaning it does not melt as quickly and thus the cookie retains its shape.