code: public static void updateUserPreferences(CmsObject cms, HttpServletRequest req) {
  
          HttpSession session = req.getSession(false);
          if (session == null) {
              return;
          }
          CmsWorkplaceSettings settings = (CmsWorkplaceSettings)session.getAttribute(
              CmsWorkplaceManager.SESSION_WORKPLACE_SETTINGS);
          if (settings == null) {
              return;
          }
          // keep old synchronize settings
          CmsSynchronizeSettings synchronizeSettings = settings.getUserSettings().getSynchronizeSettings();
          settings = CmsWorkplace.initWorkplaceSettings(cms, settings, true);
          settings.getUserSettings().setSynchronizeSettings(synchronizeSettings);
      }
docs: Updates the user preferences after changes have been made.<p>
  
  @param cms the current cms context
  @param req the current http request