flame goes out

After about 4 or 5 min the flame goes out but the ignitior starts to glow but the gas does not does not ignite. We open the door of the dryer for a few minutes then close it and it will start up again for a couple more minutes then go out again and same if open the door and wait then it will start again. any advice would be helpfull