_drupal_clean_form_sessions

Definition

_drupal_clean_form_sessions()
includes/form.inc, line 106

Description

Remove form information that's at least a day old from the $_SESSION['form'] array.

Related topics

Namesort iconDescription
Form generationFunctions to enable the processing and display of HTML forms.

Code

<?php
function _drupal_clean_form_sessions() {
  if (isset($_SESSION['form'])) {
    foreach ($_SESSION['form'] as $build_id => $data) {
      if ($data['timestamp'] < (time() - 84600)) {
        unset($_SESSION['form'][$build_id]);
      }
    }
  }
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.