/**
  * Set a powermail session and merge to old one
  *
  * @param string $name session name
  * @param array $values values to save
  * @param bool $overwrite Overwrite existing values
  * @param string $method "user" or "ses"
  * @param string $key name to save session
  * @return void
  */
 protected static function setSessionValue($name, $values, $overwrite = false, $method = 'ses', $key = '')
 {
     if (empty($key)) {
         $key = self::$extKey;
     }
     if (!$overwrite) {
         $oldValues = self::getSessionValue($name, $method, $key);
         if (!empty($oldValues)) {
             $values = ArrayUtility::arrayMergeRecursiveOverrule((array) $oldValues, (array) $values);
         }
     }
     $newValues = [$name => $values];
     self::getTyposcriptFrontendController()->fe_user->setKey($method, $key, $newValues);
     self::getTyposcriptFrontendController()->storeSessionData();
 }
 /**
  * Merges Flexform, TypoScript and Extension Manager Settings
  * Note: If FF value is empty, we want the TypoScript value instead
  *
  * @param array $settings All settings
  * @param string $typoScriptLevel Startpoint
  * @return void
  */
 public static function mergeTypoScript2FlexForm(&$settings, $typoScriptLevel = 'setup')
 {
     $settings = ArrayUtility::arrayMergeRecursiveOverrule((array) $settings[$typoScriptLevel], (array) $settings['flexform'], false, false);
 }