/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->store->set('age', $form_state->getValue('age')); $this->store->set('location', $form_state->getValue('location')); // Save the data parent::saveData(); $form_state->setRedirect('some_route'); }