Chosen Solution

I spilled soda on my MacBook Pro 13" Late 2011 model. I was quick to turn it off, open the lower case and disconnect the battery. I manage to dry it and everything works except the MagSafe. It will charge sometimes, but I have to connect and disconnect the charging cabel many times for it to work

There could be a simple issue to this problem; something like debris in the magsafe port or stuck pins in the magsafe charger. If not, then there is likely an intermittent issue with the circuitry for the onewire circuit on the logic board. This part often goes bad, since the circuitry is close to the edges of the motherboard, where liquid is likely to enter and corrode connections. Or, the DC-in board could be at fault.