In general, hard cheeses like cheddar or Parmesan have a longer shelf life than soft cheeses like Brie or Camembert, but as far as soft cheeses go, cream cheese is relatively hardy. According to experts at the Dairy Council of Michigan, the shelf life of cream cheese can be as long as two weeks. The best way to extend the shelf life of your cream cheese, and make sure it lasts as long as possible, is to store it correctly—and that means keeping cream cheese refrigerated.

But life happens, and sometimes it takes a little longer to get home from the supermarket than you anticipated or you forget to put your cream cheese back in the fridge after using it. So how long can cream cheese be unrefrigerated safely?

The bad news for those who like playing it fast and loose with their dairy is that you're really not supposed to let cream cheese sit out unrefrigerated overnight. US Department of Agriculture's Food Safety and Inspection Service always recommends keeping refrigerated foods like cream cheese out of the so-called "danger zone," which is essentially room temperature, for extended periods of time. That's because disease-causing bacteria like E.coli grow fastest between 40°F and 140°F. So according to the food safety experts at the US government, cream cheese shouldn't be out of the fridge for longer than two hours.

So if you're going to serve up a bagel bar with cream cheese at brunch, your best bet from a food safety perspective is to put those tubs of cream cheese on ice. If you are going to bring a bagel with cream cheese to work, consider bringing an ice pack to keep your cream cheese cold and out of the danger zone. Sure, it's a little dorky, but it's definitely better than getting salmonella.