The present invention relates to a cosmetic composition containing at least one water-soluble or water-dispersible polymer which has, in incorporated form,a) 5 to 50% by weight of an α,β-ethylenically unsaturated monomer of the formula Iwhere R1 and X1 are defined herein,b) 25 to 90% by weight an N-vinylamide and/or N-vinyllactam,c) 0.5 to 30% by weight of a compound having a free-radically polymerizable, α,β-ethylenically unsaturated double bond and a cationogenic and/or cationic group per molecule, andd) 0 to 30% by weight of an α,β-ethylenically unsaturated monomer of the formula IIwhere R3, X2, and R4 are defined herein, and the salts thereof.