Magic cookie

from Wikipedia, the free encyclopedia

A cookie ( English [ ˈkʊki ]; in German biscuit or cookie ; also Magic Cookie , English for magic cookie ) is a short data packet that is exchanged between computer programs and has no special meaning for them. The term is often used synonymously to the HTTP cookies in the World Wide Web , it is a special form of the magic cookie, which is exchanged between web browser and web server , but is completely meaningless for them and only for the web application , e.g. B. an online shop , takes on a meaning, such as the content of a virtual shopping cart .

Early use and generic concept

The term magic cookie appeared in the man page of the fseek routine of the C standard library and dates back to at least 1979. There the implementation of the C function ftell is described: While it is actually supposed to indicate the current position of the read pointer within a stream (e.g. an open file), in some UNIX versions it returned a magic cookie , which is a differentiation allowed two states, but gave no further information. In this sense, a cookie like a token was used, which (without further context) has no meaning, but its uniqueness allows it to be correctly assigned. This can be compared to a cloakroom tag on a public cloakroom at an event: it only has value if you go back to the cloakroom with it.

Cookies are therefore closely related or often used synonymously with the concept of magic numbers , security tokens or network tokens and are therefore widespread in many areas of application.

Different examples of magic cookies

HTTP cookie

Cookies are used to store information associated with a website or domain locally on the computer for some time and to transmit it to the server again upon request. This allows the user to customize the website for himself, e.g. B. choose the language and font size or design of the website in general. Cookies can also be used to get traffic to authenticate with them is session identifier (Engl. Session ID ) stored.

The term cookie in this context essentially goes back to the American programmer Lou Montulli in 1994. Busy with the problem that browsers could not remember which pages the user had already visited, he developed a new technique which he initially called "persistent client state object". It was a five-page programming text that was supposed to give the Internet a memory . When earlier computers used bits of code for identification purposes to jump between previously viewed pages, earlier programmers called these “magic cookies”. Montulli simply called his program Cookie .

See also : Flash cookie as a special form of HTTP cookie and web storage as a further method

Authentication cookies for X11

Magic cookies are a central authentication method in the X Window System . It enables X clients (user programs) to establish a connection to an X server (presentation display). This is usually a file that is specially protected with Unix file rights and that contains a secret character string that only the X server knows.

Fortune cookies

When logging into Unix operating systems, the computer program Fortune is often started, which displays a random message (English Fortune cookie , fortune cookie ).

Individual evidence

  1. UNIX Programmer's Manual. 7th Edition, Volume 1, FSEEK (3S), Bell Telephone Laboratories, Murray Hill, New Jersey, January 1979.
  2. UNIX Programmer's Manual. Volume II (Library), FSEEK (3S), 4.2 BSD, February 12, 1983.
  3. Distributed Erlang . erlang.org. Retrieved February 3, 2014.
  4. RFC 6265 . - HTTP State Management Mechanism . [Errata: RFC 6265 ]. April 2011. (Replaces RFC 2965 - English).
  5. ^ John Schwartz: Tracks in Cyberspace: Giving the Web a Memory Cost Its Users Privacy. In: The New York Times . September 4, 2001, accessed February 10, 2014 .
  6. Xsecurity . X.org. Retrieved February 3, 2014.
  7. duden.de