Remembrance Of Things Past

By Marcel Proust (1871-1922).

A meditation on memory. A lengthy and prophetic allegory of databases and persistence techniques.

In one of the more surreal of my college days, when I was a computer geek studying English literature, one of my professors described the scene from this book where the narrator's memory of childhood is triggered by a particular kind of cookie. I thought she had suddenly started talking about web browsers, somehow.

"I raised to my lips a spoonful of the cake... a shudder ran through my whole body and I stopped, intent upon the extraordinary changes that were taking place.... The sight of the little madeleine had recalled nothing to my mind before I tasted it [but] as soon as I had recognized the taste of the piece of madeleine soaked in her decoction of lime-blossom which my aunt used to give me... immediately the old grey house upon the street, where her room was, rose up like a stage set to attach itself to the little pavilion opening on to the garden which had been built out behind it for my parents."

Does anyone know? Could that be the origin of the CS term "cookie" (which certainly predates web browsers)?

"Cookie" comes from "magic cookie". A magic cookie is an opaque piece of data which you are not supposed to understand, but which can be returned verbatim to the piece of software which originally handed you the cookie. Presumably, the software that handed you the cookie knows what it means.

Example: according to the ANSI C standard, the ftell() function (which gives the position in a file) is allowed to give you a magic cookie, i.e. an otherwise meaningless number that can only be used as an argument to fseek().

Where does "magic cookie" come from? Is it a 60's drug reference? Or does it refer to Alice in Wonderland?

I thought it was related to a fortune cookie. Like a fortune cookie, a magic cookie contains data that is meaningless to the receiver.


EditText of this page (last edited May 21, 2003) or FindPage with title or text search