Most cream pies are straightforward affairs. For example, a coconut cream pie simply consists of a pie shell filled with a cream-based custard, liberally flavored with coconut. The Boston cream pie is an exception, because despite its name it's really a cake. The layers of sponge are filled with pastry cream, and then the top is glazed with chocolate. Individual portions can be made in the form of cupcakes, but -- like the full-sized cake -- the cupcakes must be refrigerated once they're baked.
A High-Risk Filling
Although the cupcake itself and its chocolate glaze are both safe at room temperature, the cream filling in a Boston cream pie is highly perishable. It usually contains milk or cream, eggs, butter and sugar, all of which provide rich sources of nutrition to potentially hazardous bacteria. Once it's made the cream filling must be refrigerated to maintain food safety, and the cupcakes must also be refrigerated once they're assembled. At serving time, the cupcakes can remain at room temperature for up to two hours without ill effect, but after that time any that remain uneaten should be thrown out.