Sounds like Park/neutral switch. If it happens after a ride (not on cold engine) it'* definitely it. There is a simple way to check. If you car doesn't start just let somebody to turn on start key. Then you need to go down to the starter. You'll see there to wires (one to starter itself another one to solenoid. Take a screwdriver and connect two contacts for a second (your assistant should try to start engine at this moment). If car starts - it'* switch. If not - that'* starter. Don't do this many times you can kill starter.