If its a relativly new cooker the burners on the top will have a thermocouple. If the thermocouple is faulty then the gas valve wont let the gas stay on when the gas tap is released.
The other solution on some cookers is to take the gas tap off cooker as you would to clean under them, stuff a small piece of paper down the spindle hole on the tap. This will push the spindle into the gas tap a fraction more connecting the flame failure device letting the gas stay on.
Hope this helps!
Andy Mills, April 2007