magic cookie


magic cookie

(1)Something passed between routines or programs that enablesthe receiver to perform some operation; a capability ticketor opaque identifier. Especially used of small data objectsthat contain data encoded in a strange or intrinsicallymachine-dependent way. E.g. on non-Unix operating systemswith a non-byte-stream model of files, the result of "ftell"may be a magic cookie rather than a byte offset; it can bepassed to "fseek", but not operated on in any meaningfulway. The phrase "it hands you a magic cookie" means itreturns a result whose contents are not defined but which canbe passed back to the same or some other program later.

magic cookie

(2)An in-band code for changing graphic rendition (e.g. inversevideo or underlining) or performing other control functions.Some older terminals would leave a blank on the screencorresponding to mode-change magic cookies; this was alsocalled a glitch (or occasionally a "turd"; compare mouse droppings).

See also cookie.

magic cookie

A small data file passed from one program to another and sent back without change. Typically used in Unix systems, a magic cookie may be an identification token or password that activates a function. The "magic" implies some obscure data known only to the software and not the user. The Web cookie term was coined after magic cookie. See cookie.