Joule Heating
Here is the deal. Once metal heats up to the point it can melt or burn anything around it, it oxidizes. Oxides have a much higher resistance than copper. And where there is resistance to electron flow, there is heat. Lots of it.
Replacing the cord will get rid of the oxides on the blade, but will not rid of the oxides on the outlet's leaf contacts.
Meaning you could change the dryer cord 100 times, and it will still keep burning up. That is assuming a fire doesn't begin sooner. In fact it will, sooner or latter.
You need to replace the cord, receptacle, and even cut/re-strip a few inches of wire behind the receptacle- all at the same time. You need fresh, unheated metal on the blades, leaf springs and conductor terminating to the back of the receptacle.
If all 3 aren't done at the same time, high heat from any one will irreversibly oxidize (damage) the other two.