I'm looking at multi-step forms with Drupal. I've had this working on Drupal 5, and am migrating my module to Drupal 6. I've noticed that core forms.inc now uses cache_set/cache_get for storing form information between requests, where it used to use $_SESSION. I also have need to store form information between requests, and actually need to get my data stored before the first form request (so I need to do it outside $form_state['storage']).
Both $_SESSION and cache ultimately end up in the database, but the session feels a bit more tied to the visitor than cache (I'm guessing the cache may get cleared separately from the sessions table, which could cause weird looking usability problems if stuff is stored in cache, but seemingly FAPI developers think this is a managable risk).
The question I have is should I use $_SESSION or cache_get/cache_set? I'm angling towards cache because this is what FAPI3 uses for $form_state['storage'], but I don't know why that's considered better...
Comments
Answer
Hi,
This is a very dated post and nobody has come back to you. I have found the below tutorial. If you havn't come right yet which guess you probably have, have a look at Code sample #10:
http://drupal.org/node/262422
Davin