I remember when flying as a little kid from Munich to London that little me was allowed to sit on the pilot's chair - I believe my parents even have a photo of it. Note, this was before 9/11.
I have seen a child sitting in the pilot's seat on a U.S. domestic flight while boarding a plane a few months ago. Before the plane is away from the gate, there is probably no restriction.
Disallowing passengers access to the cockpit is likely the most meaningful post-9/11 change to preventing aircraft hijackings.