Many natural products have mild hallucinogenic effects - these are usually so mild that they only become apparent through causing 'weird' dreams. Some cheeses - particularly mature varieties - are known to have these qualities. Various chemicals within the cheese are involved, including tyrosine.
There is no real risk involved with eating cheese before retiring - many people, including myself, love the type of dreams which they induce. Some other foods, however, have much stronger hallucinogenic effects - with associated risks. (Deaths have occurred from people overdosing on nutmeg, for example).
Chris