Why doesn't my token redirect to the previous url?
If you want to Redirect to previous drupal page after login, you can try this. 

print l("Login","user/login",array('query' =&gt; drupal_get_destination()));


see drupal_get_destination