The device has a portioning device supplying a portion of raw paste to a cooling chamber (1) which is followed by a drainage chamber, with a single rotary shutter flap acting as the outlet valve of the cooking chamber and the inlet valve of the drainage chamber. The shutter flaps (3) at the inlet of the cooking chamber and the outlet of the drainage chamber are displaced transverse to the flow direction at the inlet and outlet respectively and are pressed against the chamber openings at a shallow angle.