We have not had open cockpits enroute over the US for over 30 years or so, except for regular Fedex employees who could jumpseat on their company flights and visit cockpits before 9/11, or an airline ferry flight under general aviation rules (Part 91), which can allow a family member onboard to observe through the open cockpit door ; so the question has little meaning here, except for visits at the gate.
When I was in college in the mid 70s, a US Navy P-3 visited a nearby airport and several of us were allowed to sit on the hard floor near the ASW gear, far from the cockpit, as just one of Naval Aviation's recruiting methods.
This ride on the floor listening to those four loud Allison T-56 engines (spinning large props at 1,021 rpm) did nothing at all to interest me in flying, being able to see only the back of the Flight Engineer while bouncing around the pattern in springtime winds. The Navy Squadron or Wing should have allowed groups of two or so to take turns in the cockpit for short periods, and planned flights at a higher, more relaxed altitude (above 10,000') on a short cross-country flight.