Drupal 7.14, Webform 7.x-3.17 : I built a webform that has a hidden field "lt_email", and I'm assigning a session value to it using hook_form_alter -
function wbl_form_webform_client_form_1_alter(&$form, &$form_state) {
$form['submitted']['lt_email']['#default_value'] = $_SESSION['Some']['Email'];
}
When I var_dump or dpm the ($form) I see the session value for lt_email, but after I hit submit on the webform, the value goes away, it doesn't get assigned.
Since %session[id] didn't handle multi-dimensional session arrays, I used the hook_form_alter workaround. I was under impression hook_form_alter would grab the session value, assign it to hidden field, and once submitted, the hidden field would retain the value, which I then use as the email component for the webform that gets triggered automatically. THe hidden field is blank upon submit.
I'm logged in as root, and all the other fields retain value upon submit (ie, name, address).
#value
instead of#default_value
gets you a better result.