My Dad was a pilot, and we'd often align a family vacation with one of his flights. There was no prouder moment as a young kid than being invited into the cockpit to "start the engines" after push-back. I vaguely remember pushing some button and Dad pointing out a moving dial in the cockpit. I vividly remember walking back to my seat feeling like the biggest kid in the world.
That kind of thing definitely wouldn't happen post 9/11.
Some tip that I read on the internet if your child wants to have a look into the cockpit: don't ask before the take-off because at that time the pilots will have a lot of things to do (doing checklists, preparations, ...). On the other hand, after the landing asking to let your child see the cockpit will have a much higher chance of being successful.
My kids have been in the cockpit post 9/11. But you have to do it before takeoff. They don't let anyone in there during flight, even the flight attendants (except the lead sometimes).
My kids just ask as we are boarding the plane if the cockpit door is still open.
I've seen it happen while the plane is at the gate. The pilots usually have the door open, and you can go up and talk to them. Worst case they say no, so its worth an ask.
Somewhere I still have a Delta wing pin from a trip I took as a kid and got to see the cockpit en route. Very cool experience that I remember to this day — I hope your and others' kids get to experience some piece of it themselves!