If you are at the airline gate, you don't have to go through immigration or security. Many international airports have the concept of transit passengers, who don't do through immigration but can hang around the shopping and restaurants areas.