I've had this problem for more than a year, and have had the gas cap changed, and it still happens off and on.
check engine randomly comes on and goes off since September, now I am having problems getting the gas cap off. Code that comes up is cylinder 1 misfire.
Gas Cap failed and caused engine light to come on.
If gas cap isn't screwed on tightly, Check Engine light will come on after a few times. After correcting problem, it takes several more good trips (far enough to heat engine) before it goes out.
I've had this problem twice since I've owned this car (6 months). The first time it just went away on its own after reading a "small evap leak" check engine light code. Light came on again just 3 days ago... hoping it will just go away on its own again.