The first patent for cyanoacrylate was filed in 1942 by the Goodrich Company as an outgrowth of a search
for materials suitable for clear plastic gun sights for the war effort. The main ingredient in instant Krazy glue is a chemical called cyanoacrylate, an acrylic resin that forms a bond (cures) almost instantly.
In general, cyanoacrylate is an acrylic resin that rapidly polymerizes in the presence of water (specifically hydroxide ions), forming long, strong chains, joining the bonded surfaces together. Because the presence of moisture causes the glue to set, exposure to normal levels of humidity in the air causes a thin skin to start to form within seconds, which significantly slows the reaction. Because of this cyanoacrylate is applied thinly, to ensure that the reaction proceeds rapidly for bonding.
The reaction with moisture can cause a container of glue which has been opened and resealed to become unusable more quickly than if never opened. To minimize this reduction in shelf life cyanoacrylate, once opened, can be stored in an airtight container with a package of silica gel desiccant. Another technique is to insert a hypodermic needle into the opening of a tube. After using the glue, residual glue soon clogs the needle, keeping moisture out. The clog is removed by heating the needle (e.g. with a lighter) before use. The polymerization is also temperature-dependent: storage at zero degrees or below stops it, so keeping it in the freezer is also effective.