Did you have cheese for supper Pat? I suspect that's another old wives tale
There's a sound reason for considering cheese to be a driver for weird dreams.
Cheeses of numerous varieties are rich in the amino acid phenylalanine. This is a known, and relatively potent, neurotransmitter. One that, with some appropriate lab chemistry, can be used as the basis for synthesis of an entire class of psychotropic drugs in the phenylethylamine class, such as the various amphetamines.
Yes, that's right, one of the amino acids in your food is chemically related to an entire family of Class A drugs (as defined in UK law under the Misuse of Drugs Act). There's even a book on the subject,
PiKHAL, by Alexander Shulgin, which delves into the details of phenylethylamine chemistry to an extent that will possibly earn you prison time in numerous jurisdictions if you repeat some of the experiments cited therein.
Indeed, while on the subject, a related tangential diversion notes how a vast range of, er, 'recreational pharmaceuticals', are chemically related to a host of natural brain endorphins and neurotransmitters.
We have natural opioids controlling functions as diverse as pain modulation and bowel control (yes, the anti-diarrhoea medication Loperamide is an opioid, that stops you crapping yourself when you have salmonella or dysentery). Anandamide is a natural brain endorphin with striking chemical similarity to cannabinoid drugs.
Several alkaloids also mimic the action of neurotransmitters via relevant chemical similarity - nicotine being a potent example, along with atropine and scopolamine. Yes, you have analogues of these alkaloids occurring naturally in your brain, whose action is to couple with certain receptors for serotonin and melatonin. Nicotine and other alkaloids couple to the same receptors, and powerfully at that. The fun part being that synthesis of serotonin, melatonin, and various alkaloids, all start biochemically with another amino acid, namely tryptophan. Which again you can find in fair abundance in cheeses.
Here endeth today's lesson in biochemistry.