according to this I wrote below code to create temp user and login , , user create but it not logged in. where is problem?
$user_info = array(
'name' => 'temp-payment-'.rand(1,999),
'pass' => user_password(),
'mail' => 'no@no.com',
'init' => 'temp-user-'.rand(1,999),
'status' => 1,
'roles' => array(DRUPAL_AUTHENTICATED_RID => TRUE),
'access' => time(),
);
$user = user_save('',$user_info);
if($user) {
$GLOBALS['user'] = $user;
drupal_save_session(TRUE);
ym($user);
}
drupal_goto('/user');