Magic Cookie

In computing, a magic cookie, or just cookie for short, is a token or short packet of data passed between communicating programs.

The cookie is often used to identify a particular event or as "handle, transaction ID, or other token of agreement between cooperating programs".

Usage

Cookie data is typically not meaningful to the recipient program. The contents are opaque and not usually interpreted until the recipient passes the cookie data back to the sender or perhaps another program at a later time.[citation needed]

In some cases, recipient programs are able to meaningfully compare two cookies for equality.[citation needed]

The cookie can be used like a ticket.[citation needed]

Early use

The term magic cookie appears in the man page for the fseek routine in the C standard library, dating back at least to 1979, where it was stated:

  • "ftell returns the current value of the offset relative to the beginning of the file associated with the named stream. It is measured in bytes on UNIX; on some other systems it is a magic cookie, and the only foolproof way to obtain an offset for fseek."

An analogy is the token supplied at a coat check (cloakroom) counter in real life. The token has no intrinsic meaning, but its uniqueness allows it to be exchanged for the correct coat when returned to the coat check counter. The coat check token is opaque because the way in which the counter staff are able to find the correct coat when the token is presented is immaterial to the person who wishes their coat returned. In other cases (as is possible with HTTP cookies), the actual data of interest can be stored as name–value pairs directly on the cookie.

Cookies are used as identifying tokens in many computer applications. When one visits a website, the remote server may leave an HTTP cookie on one's computer, where they are often used to authenticate identity upon returning to the website.

Cookies are a component of the most common authentication method used by the X Window System.

References

Tags:

Magic Cookie UsageMagic Cookie Early useMagic Cookie Cookie as tokenMagic CookieComputer programComputingEvent (computing)

🔥 Trending searches on Wiki English:

Odell Beckham Jr.Steve JobsCount BinfaceBaby KeemIvory CoastSoviet UnionTrisha (actress)The Tortured Poets DepartmentIsraeli–Palestinian conflictIlluminatiRobert F. Kennedy Jr.Peaky Blinders (TV series)Jodie ComerCarlo AncelottiSerie A2024 Indian general election in Maharashtra69 (sex position)Lewis HamiltonMonkey Man (film)Tulsi GabbardMurder of XXXTentacionMoney in the Bank (2024)Chris PrattRichard Parker (mayor)Good Kid, M.A.A.D CityAdrian NeweyXHamsterMohun Bagan Super GiantKendrick Lamar discographyRebecca St. JamesFranceJohn KrasinskiJohn CandyThe Boys (TV series)Lisa Marie PresleyHenry V of EnglandStevie NicksGypsy-Rose Blanchard2026 FIFA World CupYouTube (YouTube channel)Artūrs ŠilovsBukayo Saka2023–24 UEFA Champions LeagueKeith MoonAnoaʻi familyCristiano RonaldoMadgaon ExpressKyrie IrvingCanadaDrew BarrymoreThe Three-Body Problem (novel)WrestleMania XL2024 West Midlands mayoral electionJohn F. KennedyKingdom of the Planet of the ApesRobloxLuis ArráezList of Young Sheldon episodesThe Beekeeper (2024 film)Kristen StewartDoja CatDanny TrejoSkibidi ToiletList of James Bond filmsMarilyn MonroeBaka Not NiceNaughty AmericaPresidential Medal of FreedomAavesham (2024 film)Winston ChurchillBullet ClubA Gentleman in Moscow (TV series)2024Yandex.ZenShoshanna Lonstein GrussAmy WinehouseWWE Backlash🡆 More