C standard library
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: