Drupal go to with destination
You need to use drupal_goto the same way you use url.

So what you need to do is this:

$query = array('destination' =&gt; 'node/id');
drupal_goto('user', array('query' =&gt; $query));