You can save the data in a cookie, which will be sent to the page after the login page.
Assuming that you are using the form API to create the form and that you have a field called "field name" in the function to create the form:
function my_form() {
$form['fieldname'] = array (
'#type' => 'textfield',
'#title' => 'Some fieldname'
);
$form['fieldname2'] = array (
'#type' => 'textfield',
'#title' => 'Some other fieldname'
);
}
Set a cookie in the submit handler for your form:
function my_form_submit($form, &$form_state) {
setcookie("saved_data[fieldname]", $form_state['values']['fieldname']);
}
After they log in and redirected to the second page of the form, you can read the value of the cookie (s), and if they exist, insert them into the default values for the fields:
function my_form() {
if (isset($_COOKIE['saved_data[fieldname]'])) {
$default_fieldname = $_COOKIE['saved_data[fieldname]'];
}
else {
$default_fieldname = '';
}
if (isset($_COOKIE['saved_data[fieldname2]']))...
$form['fieldname'] = array (
'#type' => 'textfield',
'#title' => 'Some fieldname',
'#default_value' => $default_fieldname
);
$form['fieldname2'] = array (
'#type' => 'textfield',
'#title' => 'Some other fieldname',
'#default_value' => $default_fieldname2
);
}
cookie , , . , cookie , .