How long can cooked food be left out in the open before it turns unsafe?

This post was originally published on CNA.