title: Simple code to expire Drupal cookie?
body: <p>With a single click this simple script will do a multi-logout of:</p>
  
  <p>Moodle</p>
  
  <p>Elgg</p>
  
  <p>2 MyBB's and</p>
  
  <p>(not) Drupal.</p>
  
  <pre><code>    &lt;?php
  setcookie( 'Elgg', '', -3600, '/', '.domain.com', false, false);
  setcookie( 'http_auth_ext_complete', '1', -3600, '/d/', '.domain.com', false, false);
  // setcookie( 'http_auth_ext_complete', '1', -3600, '/d/', 'domain.com', false, false); 
  setcookie( 'mybbuser', '', -3600, '/', '.domain.com', false, false);
  setcookie( 'mybbuser', '', -3600, '/bb/', '.domain.com', false, false);
  
     // unset all 3 Moodle cookies, the lazy way
      if (isset($_SERVER['HTTP_COOKIE'])) {
          $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
          foreach($cookies as $cookie) {
              $parts = explode('=', $cookie);
              $name = trim($parts[0]);
              setcookie($name, '', time()-1000);
              setcookie($name, '', time()-1000, '/');
          }
      }
  
      ?&gt;
  </code></pre>
  
  <p>This works on four sites but the Drupal cookie won't quit. How can I do the same with Drupal?</p>
  
  <p>Note: Drupal uses 'host' instead of 'domain', neither with or without the '.' works so far.</p>
  
  <p>Thank you.</p>
  
  <p>EDIT: 
  I'm sure the cookie twice had <em>"Host  domain.com"</em> and on another login used the more standard format <em>"Domain  .domain.com"</em></p>
  
  <p>The cookie named "http_auth_ext_complete" <strong>is getting expired</strong> and I am still logged in. Drupal uses a second cookie with the session ID as the cookie name + there is a matching entry in the session database table, also.</p>