The philosophy about no cockpit visits includes that of isolating pilots from pax; not just the cockpit. Interesting to read in one major EU (non-UK) airline's magazine: a B747 captain says that a very interesting aspect of his job is walking in the cabin and conversing with pax.
I knew old friends in an Italian charter airline that allowed visits and cabin walk-abouts mid Atlantic in early 2000's. Other countries have different attitudes.
Question: Does EASA (which is law) have a published rule on this issue?