function persistent_login_user_login_form_submit in Persistent Login 8
Submit handler for login forms to set persistent login properties.
1 string reference to 'persistent_login_user_login_form_submit'
- _persistent_login_add_form_field in ./
persistent_login.module - Helper function to add persistent login checkbox to a form.
File
- ./
persistent_login.module, line 34 - Contains persistent_login.module.
Code
function persistent_login_user_login_form_submit(&$form, FormStateInterface $form_state) {
if ($form_state
->getValue('persistent_login', FALSE)) {
\Drupal::service('persistent_login.token_handler')
->setNewSessionToken(\Drupal::service('current_user')
->id());
}
}