According to folklore, in 1670, in Cologne, Germany, the choirmaster at Cologne Cathedral, wishing to remedy the noise caused by children in his church during the Living Crèche tradition of Christmas Eve, asked a local candy maker for some sweet sticks for them. In order to justify the practice of giving candy to children during worship services, he asked the candy maker to add a crook to the top of each stick, which would help children remember the shepherds who visited the infant Jesus. In addition, he used the white colour of the converted sticks to teach children about the Christian belief in the sinless life of Jesus.From Germany, candy canes spread to other parts of Europe, where they were handed out during plays reenacting the Nativity. As such, according to this legend, the candy cane became associated with Christmastide.
A recipe for straight peppermint candy sticks, white with coloured stripes, was published in 1844. The candy cane has been mentioned in literature since 1866.It was first mentioned in association with Christmas in 1874, and only as recently as 1882 was hung on Christmas trees.