She says that bakeries near a temple outside the city of Kyoto have produced similar cookies with little messages for many generations,and she has found many references to fortune cookies in Japanes history and literature. It is possible that the custom traveled to California with Japanese immigrants in the 19th Century