Is it safe to use $_SESSION to store temporarily a user provided value under multi-step form processing I have a form which contains an AJAX button press callback. Upon pressing this AJAX button, I want to store temporarily a form element's value before fully processing all the data upon pressing main form submimission button. On the meanwhile, how do I store that particular field value? Is it fine to achieve this using $_SESSION? Is this secure? Does it work flawlessly under Drupal 7, or is there a better alternative?
Drupal has an Ajax framework for this use case. Use $form_state to store values. The API page about the Ajax framework contains a use of $form_state.