The small file websites leave in your browser, named after a Unix token, named, probably, after a fortune cookie.
Documented
Montulli's shopping cart
Lou Montulli built the web cookie at Netscape in 1994 to give a memoryless protocol a memory, taking the name from the older Unix magic cookie, an opaque token passed between programs.
Assessment: Documented by its inventor. The use case was a shopping cart, and the surveillance economy was the unplanned sequel.
Stories
Why a cookie at all
The folk chain: magic cookie comes from fortune cookie, a token with a message hidden inside. The derivation is plausible, repeated everywhere, and honestly not fully documented at the Unix end.
Assessment: A folk etymology that is probably right and cannot be proven. The archive accepts these on probation.
Interesting claims
The friendly name did real work
The claim: calling the tracking file a cookie, warm, harmless, baked, is part of why nobody feared it for twenty years. A token named after dessert bypassed a generation's defenses.
Assessment: Rhetoric with receipts: the name is documented, the two decades of unconcern are documented, and the connection is yours to weigh.
Sources and further reading
Lou Montulli's account of the 1994 Netscape cookie
RFC 2109, the cookie specification
Unix magic cookie usage history
Fortune cookie etymology, standard references
Worth asking
If the file had been called a tracker from day one, would you have clicked accept?