Try right clicking RotMG on the title screen to bring up the flash context menu then hit settings. Once on settings, navigate to Local Storage option and check the Allow box. I’m unsure if this would be the issue or not, but it’s worth a try. If this does not fix the problem then try switching to playing in Flash Projector. A guide can be found here.
As a side note: I also experience this type of issue myself. It behaves predictably, however, as every time something opens up Microsoft Edge or Internet Explorer on my computer my RotMG settings will be wiped. Do you use this browser inadvertently without realizing it?