code: public static void setAdditionalPreference(CmsObject cms, String key, String value) {
  
          CmsUser user = cms.getRequestContext().getCurrentUser();
          CmsUserSettings settings = new CmsUserSettings(user);
          settings.setAdditionalPreference(key, value);
          try {
              settings.save(cms);
          } catch (CmsException e) {
              LOG.error("Could not store preference " + key + ": " + e.getLocalizedMessage(), e);
          }
      }
docs: Sets a configured preference.<p>
  
  @param cms the Cms context
  @param key the setting name
  @param value the value