Custom login redirect failed in hook_user_login I'm trying to redirect to the user edit page just after the user logged in from the login block in the sidebar. I implemented hook_user_login, but no luck. It seems to me that drupal_goto() or $edit['rediect'] cannot take precedence over $_GET['destination']

function mymodule_user_login(&amp;$edit, $account){
    if ( user role is employee and user has not completed profile yet ) {
        // both failed to redirect, although my condition is true
        $edit['redirect'] = 'user/'.$account-&gt;uid.'/edit'; 
        drupal_goto('user/'.$account-&gt;uid.'/edit');
    }
}


I was at my home page ( mydomain.com ) and tried to log in, but when I exit in my hook, I found that the URL was changed to mydomain.com/node?destination=node. My home page path is blank in site information.

[Edit]
My condition for redirect is that if the logged in user has empolyee role and his profile is not completed yet. My usecase is very similar to this, but i don't use content profile.

I think the way of overriding $_GET['destination'] would fix my issue.
drupal_goto() will use $_GET['destination'] when it is set. The following is the code used from the function.

  if (isset($_GET['destination']) &amp;&amp; !url_is_external($_GET['destination'])) {
    $destination = drupal_parse_url($_GET['destination']);
    $path = $destination['path'];
    $options['query'] = $destination['query'];
    $options['fragment'] = $destination['fragment'];
  }


Setting $edit['redirect'] inside hook_user_login() doesn't have any effect.
What you can do is changing $_GET['destination'] in hook_user_login(). If you want to be sure the user is redirected to the path you set, you should be sure your hook is executed last, for example by increasing the weight of your module.