Reminiscent of Cookies

June 7th, 2012 by

Yesterday, @nevali posted an excellent management summary on Web browser cookies. This reminded me of ye olde days of my Atari ST hacking. In my quick research, I couldn’t find a hint on the Interwebs as to how the term “cookie” was coined. So I thought I’d put out my own hypothesis.

As the Wikipedia article on the Magic Cookie – very briefly – explains, magic numbers used in the early days sometimes were referred to as cookies. To my personal experience this seems somewhat anecdotal (and the article doesn’t bother to point to any evidence for its claims either). Back when I as an Assembler blacksmith, we just called it “magic (number)”. The cookie term was never used – at least not in my environment.

What “cookie” entails today – and IMHO that’s what sets it out from the opaque magic number – is that a cookie is used in communications between systems, or apps. I.e. it becomes transparent in that an agreed meaning is attributed to it. And it also is structured into name and value (which the magic number is not). The – to my knowledge – first use of the term “cookie” for the purpose of communications, and with the option of storing the information persistently, was in Atari’s TOS 1.0.6 back in 1989. Yes, it seems I’m that old…

TOS’s cookie jar was a re-incarnation of environment variables, with persistency added in later versions. It was used for preserving state of course, but also for communication between apps. The cookie names, and sometimes the semantics of their values was published. Hence apps were able to detect the presence and state of other apps. The UNIX developer  version of the Atari TT030 for instance, came with a 3-button mouse to enable use of X11 apps. (Apparently I had one of those, and it’s still sitting in my basement.) In the vanilla version of the Atari TOS operating system however, there was of course no support for a third mouse button. Yes, thing alike these presented problems back then. Eventually and inevitably, someone wrote an extension to make the third button available. This extension signalled its presence by installing a cookie in the cookie jar. If for example you were using some graphics app that could make use of the third button, it could detect whether the extension had been loaded, and could adapt its behaviour, e.g. by assigning shortcuts to to the extra mouse button.

Inevitably, there was also a desk accessory (you’d call that preference pane nowadays) to view, add, delete, and modify cookies manually. Just like any reasonable Web browser does today. As you can see, all the concepts of today’s browser cookies – including third party cookies – were already conceived and deployed in 1989.