>Securing the cockpit doors on planes is a good idea though.

Unless your pilot is having a particularly bad day.

I did recently see a video of a pilot that proposed to his girlfriend as she boarded his plane.

I bet all the passengers were thinking "Please, please say 'yes'", and were overly-happy both for the newly-engaged couple, and more for themselves that she did.

No, I don't have an answer to the door problem.

Eh, vetting pilots rigorously seems like it would 99% solve this. That and having more than one pilot in the cockpit makes rogue situations vanishingly unlikely, and that's the best you can do in any safety situation.