Here is the context

$form_info = array (
  'forms' = array(
    'registration' => array (
      'form id' => 'mymodule_choose_registration_form');
    'personal-details' => array(
      'form id' => 'mymodule_personal_details_form',
    'summary' => array (
      'form id' => 'mymodule_summary_form',
    )
	),
  'order' = array(
    'choose-registration' => 'Choose registration type',
    'personal-details' => 'Enter your personal details',
    'summary' => 'Summary',
	),
	...
);
...

function mymodule_summary_form(&$form, &$form_state) {

$options = array(
  'registration' => 'Register another person',
  'finish' => 'Go to payment page',
)
$form['next_task'] = array (
  '#type' => 'radios',
  '#options' => $options,
)
// output some text taken from the wizard model object (using ctools object cache)
// basically linsting the registered persons with their details
$form['summary_text'] => array('#value' => ... )

}

function mymodule_summary_form(&$form, &$form_state) {
 // if $form_state['next_task'] = 'registration'
 // Take the user to the registration form (the first form)
 // otherwise normal finish flow
}

Every thing works as expected for logged in users. But for anonymous, the forms are cached and used for all anonymous requests.
So anonymous user 2 sees the summary_text of anonymous 1...And anonymous 1 sees a summary that does not include the latest registrations he added

When i tried using $form_state['storage], to stored the 'summary_text' but then drupal expects my form signature to be mymodule_summary_form(&$form_state) and not mymodule_summary_form(&$form, &$form_state)

I feel lost... any help with be much appreciated

Comments

redben’s picture

For anyone having the same issue you can add the following code to your module to force drupal no to cache your wizard pages :

function yourmodule_init() {
  if (drupal_match_path($_GET['q'],'path/to/your/wizard/*')) {
    $GLOBALS['conf']['cache'] = FALSE;
  }
}

But if you have a nicer way of doing this i'm still interested

Thanks

redben’s picture

Status: Active » Needs review
merlinofchaos’s picture

Ahh yes, another one bitten by anonymous page caching. I don't think there's much I can really do about that, except perhaps try to document this problem somewhere.

redben’s picture

Status: Needs review » Closed (fixed)

May be adding a "Caveats and workaround" section in the advanced help ?
I have created another issue http://drupal.org/node/718028 for adding this to documentation