I have a sign up process which involves a number of forms.
To begin with, guest fill a user form which then directs to a post form.
I have added this code to keep the new user logged in:
// get the user credentials from the $_POST object
$user = array(
'user_login' => $_POST['user_login'],
'user_password' => $_POST['user_pass'],
'remember' => true
);
$login = wp_signon( $user, false );
if ( is_wp_error($login) ) {
error_log( $login->get_error_message() );
}
}
}
}
It did work, but somehow it has stopped working. I've checked the two form IDs and they are correct.
I've attached a screen grab which shows the error.
Is there any documentation that you are following?