Although the cockpit door may be locked, the concept of cockpit security varies greatly around the world. It is quite common for the cockpit door to be opened in flight and remain open while a flight crew member stands in the forward galley gathering food/beverages. I have personally observed this on TAM domestic, IB domestic, and AM international.