hook_user_login, hook_user_logout not firing I created a custom module because I want to execute some actions when a users logs in / out.

function mymodule_user_login(&amp;$edit, $account) {        
  $url = 'https://www.some_url';
  $additionalHeaders = '';

  $process = curl_init($url);
  curl_setopt($process, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', $additionalHeaders));
  curl_setopt($process, CURLOPT_HEADER, 1);
  curl_setopt($process, CURLOPT_USERPWD, $user.":". $password);
  curl_setopt($process, CURLOPT_TIMEOUT, 30);
  curl_setopt($process, CURLOPT_POST, 1);
  curl_setopt($process, CURLOPT_POSTFIELDS, $data);
  curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($process, CURLOPT_SSL_VERIFYPEER, FALSE);

  curl_close($process);
}

function mymodule_user_logout($account) {
  $url = 'https://www.some_url';
  $additionalHeaders = '';

  $process = curl_init($url);
  curl_setopt($process, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', $additionalHeaders));
  curl_setopt($process, CURLOPT_HEADER, 1);
  curl_setopt($process, CURLOPT_USERPWD, $user.":". $password);
  curl_setopt($process, CURLOPT_TIMEOUT, 30);
  curl_setopt($process, CURLOPT_POST, 1);
  curl_setopt($process, CURLOPT_POSTFIELDS, $data);
  curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($process, CURLOPT_SSL_VERIFYPEER, FALSE);

  curl_close($process);
}


I tested the code before to put it in the hook implementations, and it works.

Does anyone have the same problem?
If you are directly editing the code of a module that is already enabled, then the problem is that the list of hooks implemented by modules are cached by Drupal. Drupal doesn't have a setting for disabling this cache; the only cache you can disable/enable on Drupal is for the content served to the anonymous users.

Both the hooks you are referring are invoked by functions that, directly or indirectly, call module_implements(), which contains the following code:

  if ($reset) {
    $implementations = array();
    cache_set('module_implements', array(), 'cache_bootstrap');
    drupal_static_reset('module_hook_info');
    drupal_static_reset('drupal_alter');
    cache_clear_all('hook_info', 'cache_bootstrap');
    return;
  }

  // Fetch implementations from cache.
  if (empty($implementations)) {
    $implementations = cache_get('module_implements', 'cache_bootstrap');
    if ($implementations === FALSE) {
      $implementations = array();
    }
    else {
      $implementations = $implementations-&gt;data;
    }
  }


The cache containing the list of the implemented hooks is cleared when a module is updated, enabled, or disabled. Actually, it is enough you visit the page showing the list of the modules, click on the button to save the configuration, and the cache should be automatically reset; if that doesn't work, then you can disable and then re-enable a module.

I see the code is using variables that are not defined, nor set, by the code you are showing; I take you didn't show all the code, but if you are effectively showing all the code, then the $user, $password, and $data variables are not initialized.

As side note, you should use drupal_http_request(), instead of using the cURL functions.