When we were kids we used to look forward to our mid flight visit to the cockpit to say hello to the captain. Then security measures changed and the cockpit was locked… But even now your young tots can still enjoy meeting the Captain next time you fly.
When flying simply ask the flight attendant if your child can visit the captain after you have landed. (This is at the discretion of the individual pilot, but most know how exciting it is for kids).
Once the attendant confirms you can visit (or more likely says ‘maybe’) you will need to wait in your seats until the other passengers have disembarked and then you can go forward and ask to see the captain.
Use the time waiting on the plane (while the other passengers leave) to talk with your kids about what they might like to ask the pilot (as the adult leading by example; try not to refer to the pilot solely as a male, while it still is a male dominated profession, there is no reason to presume only boys can fly planes!)
Anica wanted to know how the plane stays up (our pilot explained the basics of wind pressure over the curved wings lifting the plane) and Elka wanted to know how rainbows are made (while it wasn’t really a plane question, he was happy to answer).
While I didn’t take and photos in the cockpit (this photo was taken later at a flight simulation that we were lucky enough to visit in Malaysia) I was carrying a large intimidating camera with me when we entered the cockpit so I believe photos are allowed should you wish to get a snap with your pilot. Remember to thank him/her immensely for giving your tot the additional time.