car wont start after cruising around

This has happened to me about 3 times now. After driving around for an hour or more if I make a stop and shut my car off when i`m ready to go again I turn the key and get nothing,if I wait around 5 minutes or so it starts right up. I have tried putting it in neutral suspecting the neutral safety switch may be the culprit but it didn`t make a difference. This has only happened on warmer days could it be a ballast resistor getting ready to fail?