login to magento 1.7 from drupal 7
The function signature is not right, which may be the reason for the code not executing.
See the docs for hook_user_login function.

The parameter $edit is passed by reference and not directly by value. So, the correct definition your function should be,

function custom_user_login(&amp;$edit, $account) {

  // rest of the code goes here (not duplicating).

}


Also make sure, your modules name is custom and it has files custom.info and custom.module in the module directory. And offcourse, enable the module ;-)

Also, to suggest you to look into the session and cookie info (based on your comment), you can put an echo '&lt;pre&gt;';print_r($_COOKIE); echo &lt;/pre&gt; inside your theme's template.php file.
Or simply install the Devel module, and enter dpm($_COOKIE); inside your template.php, to see a nicely formatted result. You'll need to clear the cache to again load the fresh template files.
Similarly, you can print the $_SESSION superglobal to see the session information.