Did you ever wonder why the cockpit door is open at boarding but closed during flight?  I once flew out of Buffalo NY. and the plane experienced severe turbulence. There were only two people on the plane, myself and my boss, so I knocked on the closed cabin door, the pilot ( who was also the ticket agent, baggage loader, and steward) obliged my request and left the door open for us. The plane eventually developed engine problems and had to make an emergency landing, which totally freaked me out (now I wished the door was closed), and was later told by a pilot friend "it's against regulations" to leave the cabin door open during commercial flight. So why is it open during boarding?

Answer:

There are many people who need to enter the flight deck prior to departure. Often there is a change of the flight crew, with one set of pilots exiting while another set arrives. The flight attendants coordinate the boarding process with the pilots. If there are problems with catering, aircraft cleaning or necessary equipment, the flight attendants work with the pilots to advise the right people via the aircraft’s radio.

After fueling, a fuel slip is usually brought to the flight deck; the pilots can then verify the proper amount of fuel and distribution in the proper tanks. If there is any maintenance being performed, the maintenance technician must sign the logbook stating that the aircraft is airworthy and the maintenance process is complete. Finally, the boarding agent will tell the captain that boarding is complete, the actual number of passengers on board and any last minute information.