Problem writing/reading string in EEPROM

If you're using an ESP8266 it will store the last connected credentials by itself, no need to try and store it yourself.