The word cookie dates from at least 1701 in Scottish usage where the
word meant "plain bun", rather than thin baked good, and so it is not
certain whether it is the same word. From 1808, the word "cookie" is
attested "...in the sense of "small, flat, sweet cake" in American
English.
Learn more on Wikipedia