We propose that in time dependent backgrounds the holographic principle should be replaced by the generalized second law of thermodynamics. For isotropic open and flat universes with a fixed equation of state, the generalized second law agrees with the cosmological holographic principle proposed by Fischler and Susskind. However, in more complicated spacetimes the two proposals disagree. A modified form of the holographic bound that applies to a post-inflationary universe follows from the generalized second law. However, in a spatially closed universe, or inside a black hole event horizon, there is no simple relationship that connects the area of a region to the maximum entropy it can contain.