The subject of the invention is a method for treating keratin materials, such as keratin fibers, which comprises i) application of a composition comprising at least one first, water-soluble hydrophilic ionic liquid A+X− comprising an organic cation A+ and ii) application of a composition comprising a soluble hydrophilic salt B−Y+ comprising an anion B−, the anion B− being such that it forms a second, hydrophobic ionic liquid A+B− by ion exchange with the first ionic liquid A+X−.This method for treating keratin materials makes it possible to improve the penetration of cosmetic active agents while retaining a cosmetic feel.