Pilot ligt wont stay light
take the electrical wiring off the terminals of the gas valve one at a time, and clean the contacts with a food grade electronics contact cleaner and degreaser. Make sure all wiring is tight, not loose fitting, and clean. The thermo coupler, or sometimes used thermopile (multiple thermocouples in one) generates a small amount of electrical current when heated. The oil residue on a gas valve's electrical contacts SHORTS OUT THE MINUTE CURRENT GENERATED not giving enough current to hold the valve open.
The next thing, how high is your pilot set? If the flame is not striking the thermo pile properly, if its not directally in the flame, it will not generate enough current to hold the gas valve open. Sometimes a dirty thermo pile just cleaned up with sandpaper will work again (accumulated material acts as an insulator)
If you have access to a very high end electrical meter that is capable of measurung MICRO AMPS (very few) then you should check the actual current ouput of the themo pile.
Another thing, the gas valve solonoid MAY BE DEFECTIVE! IF YOUR THERMO PILE is of the screw in type vrs screwed on type, remove the gas valve end, degrease the inside and also that of the thermo pile surfaces, then use the CLEAN errasser of a pencil to clean both the inside of the gas valve connection, and also that of the thermo pile contacts. NO ERRASSER RESIDUE CAN BE LEFT ON EITHER SURFACE! Do not touch these contact surfaces with your hands because even the resistance of the body oil on these surfaces can mean the differance between it working or not!
The thermo pile or a thermo couple generates a minute amount of current that holds the gas valve on.
PS: and that didn't even cost you a dime, I'm off to an emergewncy service call to fix yet another McDonalds deeping fryer (don't call them beeping fryers cause they beep either!!!)