The historical past of fortune cookies goes back towards the 13th and 14th centuries when China was occupied by the Mongols.
The traditional lotus nut paste moon cakes were chosen for which to conceal secret messages about the date of a famous rebellion against the invaders. The moon cakes were distributed by the loyal revolutionary Chu Yuan Chang (disguised being a Taoist priest) who was safe with the understanding that the Mongols had no taste for lotus nut paste. The rebellion was successful and therefore the foundation of the Ming Dynasty was established.
The transition from moon cakes to modern-day fortune cookies was created out of basic need in the difficult times of the American gold rush and also the railway boom. When the Chinese 69'ers were constructing the great American railways from the Sierra Nevada to California they place joyful messages inside of cookies to exchange during the moon festival as an alternative to cakes, therefore fortune cookies started.
A cottage business came forth as the Chinese settled down in San Francisco and right up until 1964 (when the very first automated production began) the cookies were produced by hand.
** Asian Recipes