Replace file object by sharedPreferences for cookies