The cortex is a layer of cells situated between the epidermis and the vascular tissues in plants. In cacti, the cortex often contains mucilage cells, which produce a sticky substance that can help in water retention. The cortex also acts as a storage site for nutrients and can be involved in photosynthesis, especially in species where leaves are reduced or absent.