You can visit the flight deck and chat with the crew as long as you are at the gate and the engines are off. I have been asking for years, and I have only been rejected around 2-3 times. All of the pilots these day's are really friendly and if one isn't, the other one certainly will be. Last time I flew, the FO was very friendly and did most of the talking while the Captain just jumped in a few times and prepared the cockpit the rest of the time. As soon as you board, ask the flight attendent at the door if it would be possible for you to visit the cockpit, and almost all of the time they will say ok. After the flight, you can ask the pilots who always say "Bye" at the cockpit door.