Apparently the term comes from The Andy Williams Show's "Williams' Wierdos" sketches which had a character called "Cookie Bear". In these sketches, a man in a bear suit tried all sorts of tricks to get a cookie out of Williams. The sketches would always end with Williams shrieking, "No cookies! Not now, not ever...NEVER!!!", and the bear sadly wandering offstage.
From the Jargon File 2.4.2 (used by permission)