Cockaigne was the Big Rock Candy Mountain of medieval Europe, where the living was easy and the land flowed with milk and honey. This mythical country had houses of barley sugar, roofs of cakes, rivers of wine, and streets paved with pastry; buttered larks (a delicacy of the period) fell instead of rain; roast geese passed slowly down the streets, begging to be eaten; even better, shops provided goods without asking for payment.
The name turns up first in a thirteenth-century French satirical poem that refers to the pais de cocaigne, literally "land of plenty" (modern French spells it pays de cocagne with the same meaning and also has vie de cocagne for a life of pleasure). Where the word comes from has never been settled to the satisfaction of scholars, but the many references to sweetmeats in the poem support the view that the name originated in a Germanic word for a cake, probably the ancestor of modern German kuchen.
The idea of Cockaigne was popular in the fourteenth and fifteenth centuries, in writing and in illustration (Pieter Bruegel the Elder painted it under its German name Schlaraffenland; in the nineteenth century the German version of the tale was collected into a book by Ludwig Bechstein). An English poem of about 1305 called The Land of Cockaign satirised the life of monks in the same terms. Two centuries later, Lubberland became popular in England as an alternative (a lubber being a big, clumsy, stupid man who idles his life away, whose name appears in the sailor's landlubber for a clumsy or incompetent seaman).
To start with, Cockaigne wasn't linked to any place that actually existed — it was all too obviously an exotic fantasy. However, in the early years of the nineteenth century it began to be applied to London, surprisingly so you might think for a noisy, smoky, dirty city of vast inequalities that so obviously could not be the land of legend. But it was a joke, of course: where else could Cockneys live but in Cockaigne?
The names are similar enough that some writers have argued that the origin of Cockney indeed lies in Cockaigne and that the link isn't a joke at all. However, the dates don't fit. It's known that Cockney is from a late Middle English term for a pampered child; where that comes from is uncertain, but an earlier theory that it's from cokeney, a cock's egg, a disparaging name for a small misshapen egg, isn't now believed either. (from World Wide Words)