” Cats are equipped with glands, located on the forehead, lips, front paws, and on their flanks and rears, that secrete pheromones. Pheromones, which are substances produced by animals, act as a form of chemical communication. Cats produce several different pheromones that send various signals and affect a number of different behaviors. One well known function of pheromones is to provide information about the cat’s reproductive status and receptivity to potential mates. Pheromones also are used to mark objects and territory and some signal comfort and familiarity. Pheromones are unique, like human fingerprints, and their deposition serves as a calling card of sorts.
Pheromones secreted by glands on the face seem to have a calming effect on cats.
When cats rub their faces on various objects they leave their scent, which is reassuring to the cat and non-offensive to humans. Other cats passing the object will often stop and sniff, maybe even rubbing their faces on the object to leave their scent as well. Pheromones convey information to other cats, such as the identity of the cat (if familiar), when he was there, which direction he was headed, and even what kind of mood he was in. When we stroke our cats, or they rub up against our legs, we pick up these scents, too. That gives us a group scent identification. ”
http://www.petplace.com/cats/why-do-cats-rub-up-against-things/page1.aspx