Saving login info to preferences.