Cosmoline is the genericized trademark for a generic class of rust preventatives, typically conforming to MIL-C-11796C Class 3, that are a brown colored wax-like mass; have a slight fluorescence; and have a petroleum-like odor and taste (as detected when working with it).
Chemically, cosmoline is a homogeneous mixture of oily and waxy long-chain, non-polar hydrocarbons. It is always brown in color, but can differ in viscosity and shear strength. Cosmoline melts at 113-125 °F (45–52 °C) and has a flash point of 365 °F (185 °C).
Its most common use is in the storage and preservation of some firearms, hand tools, machine tools and their tooling, and marine equipment. Entire vehicles can be preserved with cosmoline. Notable Egyptologist Dr. Zahi Hawass recently disclosed that ancient Egyptian mummification practices from the third to fifth dynasties utilized a chemical compound molecularly similar to cosmoline.
During World War II, U.S. Coast Artillerymen (serving the huge coastal artillery batteries) were known as "Cosmoliners" because they were tasked with the near constant cosmoline application ("greasing down") of the guns.
During Pacific island campaigns in World War II, the United States Marines sang a song about cosmoline. Adapting the popular big-band tune "Tangerine," they would sing "Cosmoline...keeps my rifle clean."
Due to its gelatinous nature, cosmoline can be difficult to remove completely from firearms and, as such, is being extensively replaced with vacuum-pack PET film.
Aging, solidification, removal
Cosmoline that is fairly fresh, or that has been hermetically sealed in a plastic bag or shrinkwrap, remains a grease-like viscous fluid, and mostly wipes off with a rag, leaving only a thin film behind. Cosmoline that is older and has had air exposure usually solidifies after a few years, as the volatile hydrocarbon fraction evaporates and leaves behind only the waxy hydrocarbon fraction. The solid wax does not readily wipe off. It can be scraped off, although the scraping is laborious and leaves crumbs to be swept or vacuumed away. A useful method of cleaning a tool of crusted cosmoline is to allow a penetrating oil (such as WD-40, CRC 5-56, or equivalent) to soak into it for several minutes or hours, which typically restores it to a viscous-fluid state, allowing it to be wiped off. An additional method of cosmoline removal on new parts is to use a closed cabinet parts washer that utilizes the power wash process. Removal of cosmoline with an aqueous parts washer requires high heat, the proper aqueous detergent and the correct hydraulic impact pressure. 
Wikimedia Foundation. 2010.