The invention concerns a method of treating keratin matter such as keratin fibres, comprising the following steps: (i) applying a composition comprising at least a first water-soluble hydrophilic ionic liquid A+X- comprising an organic cation A+; and (ii) applying a composition comprising a soluble hydrophilic salt &Bgr;-Y+ comprising an anion B-, anion B- being such that, by ion exchange with the first ionic liquid A+X-, a second, hydrophobic, ionic liquid A+B- forms. This method of treating keratin matter improves the penetration of cosmetic agents whilst preserving the cosmetic effect.