Cooked beans become slimy due to the proliferation of bacteria that thrive in warm temperatures. These bacteria produce extracellular polysaccharides, which contribute to the slimy texture.
When beans are cooked, the high temperatures kill most bacteria present. However, some heat-resistant spores may survive. If the cooked beans are left at room temperature for an extended period, these spores can germinate and multiply rapidly. Many bacteria, including some Bacillus species, produce a capsule or slime layer composed of extracellular polysaccharides. This slime is a protective mechanism for the bacteria and also helps them adhere to surfaces. As the bacteria multiply and produce more of this slime, the beans develop a noticeable slimy texture. Proper cooling practices, such as quickly refrigerating the beans, inhibit bacterial growth and prevent the formation of this slime. The faster the beans cool, the less time the bacteria have to multiply and produce the undesirable slime.
To cool cooked beans quickly, spread them out in a shallow container or divide them into smaller portions before refrigerating. This increases the surface area exposed to the cooler air, accelerating the cooling process and minimizing bacterial growth.