The layered cookies come with controversies and the discreet mention of sex. Oh my! (Chicago Tribune/Bill Hogan)

This is the story of a legendary food. And as with all legendary foods, there are tall tales, controversies and — at least with Nanaimo bars — the discreet mention of sex.

The layered cookies get their name from a town called Nanaimo — say nuh-NIGH-moe — on Vancouver Island, a bay away from where the 2010 Olympics were held. They are a sweet pleasure with a base of crushed graham crackers, nuts and coconut topped with a buttery middle layer, then finished with glossy semisweet chocolate.

There are variations on this theme, of course. Some recipes use Bird's Custard Powder in the filling, others peanut butter.

By most accounts, the recipe traces its roots to the church ladies of Nanaimo. Some say the treats were originally called Mabel bars. The biggest dispute? That the bars really were created thousands of miles away and are called " New York Slices."

For insight we tracked down a University of Victoria English professor and fifth-generation Nanaimo native named Kim Blank. When he wasn't writing about Wordsworth and Shelley, Blank wrote the humor book "Sex, Life Itself and the Original Nanaimo Bar Recipe."

"Nanaimo bars always have been famous around here as having mythological origins," he told us. "However, no one has been able to claim to have found the origins of the recipe, except my dear old mum." Mum it turns out, had a beat-up recipe book from the Women's Association at Brechin Church dating to the early 1950s. "As far as I was concerned, being a literary scholar, now I had textual evidence."

He also stuck the recipe in the back of his "Sex" book. "How could you go wrong with sex and food?"

Can't argue with that.

Nanaimo bars

Prep: 25 minutes
Cook: 12 minutes
Chill: 1 hour, 45 minutes
Makes: 48 bars

-- Canadian Living magazine has run numerous recipes for these bars, including this version.

2 eggs, lightly beaten
1 1/3 cups butter, melted, plus 2 tablespoons unmelted
2/3 cup cocoa
1/2 cup granulated sugar