Take a clean dry toothbrush or stiff hobby paintbrush.
Brush vigorously the the charging port on the phone. Repeat brushing/cleaning on the charging cord.
Sounds like oxides have built up on the port/cable.
Good luck
You may want to try using isopropyl alcohol on a q-tip or stiff brush. This is a bit more aggressive method for removing the oxide buildup on the edges of the charging port and jack. Obviously you will not want to pour ANY liquid into the port.
I usually hold the phone in a vertical position to ensure no liquid can go into the port itself.