already been answered but here's all the important points for cakey cookies, perhaps it will help explain whats going wrong:
1. flour to water; cakey cookies should be 100 parts flour to 38 parts water (but that in grams in divide for a simple recipe answer).
2. Protein content of flour; higher protein flours will absorb more water and form stiffer bonds, making the cookey stiffer. Ideal protein content is an all purpose 7-9%)
3. Sugar; As the sugars melt at higher temperatures they dilute the mix and will cause the batter to spread, and will crytsalise into a crunchy texture when cooled. You can save this by reducing oven temperature and/or substituting some of the table sugar for another form of sugar (honey, corn syrup, molasses...etc...).
4. Eggs; eggs are the gelling agents for moisture in the cookies; it should be around 30 parts egg by weight to the other ingredients (not 30%- put it into grams to think simply).
5. Fat; lubricates and distorts the flours proteins. However this encourages the cookie to spread. Especially butter! (butter is about 15% water which will dilute the batter- and melts at a lower temperature, which allows for a longer time for the batter to spread before its sets), vegetable oils will give you a much more consistent result, unless you reduce the water to include the water that will be released from the butter.
6. Baking; over-baking dries out the cookie. Under-baking produces a chewier result, with more moisture trapped in the starch gels. Use a lower oven temp, to control the heat of the cookies more (higher temps set faster, but can continue cooking the cookie with residual heat)
Hope this helps.