Cats rub against people to communicate, leave their scent, show affection and claim their companions. Rubbing against legs is also a form of feline greeting. Additionally, by rubbing against a human's leg, the cat leaves an undetected odor to identify her as part of its clan.
A cat has glands on its forehead, front paws and flanks, each of which secretes pheromones that serve as a chemical communication. The rubbing leaves behind these pheromones, which then signal and give information to other cats, marking a cat's territory and objects. Similar to a human fingerprint, each cat's pheromone signature is unique.