You are here

public function SessionCacheSettingsForm::submitForm in Session Cache API 8

File

lib/Drupal/session_cache/Form/SessionCacheSettingsForm.php, line 70
Contains \Drupal\session_cache\Form\SessionCacheSettingsForm.

Class

SessionCacheSettingsForm
Menu callback and form-builder for session cache configuration settings.

Namespace

Drupal\session_cache\Form

Code

public function submitForm(array &$form, array &$form_state) {

  // Not sure which of these first two lines is better

  //$this->configFactory->get('session_cache.settings')
  config('session_cache.settings')
    ->set('storage_method', $form_state['values']['storage_method'])
    ->set('expire_period', $form_state['values']['expire_period'])
    ->set('use_uid_as_sid', $form_state['values']['use_uid_as_sid'])
    ->save();
  parent::submitForm($form, $form_state);
}