Posted By

wildpeaks on 11/04/10


drupal drupal6

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Drupal: programmatically log out the user

 / Published in: PHP

Important: this snipplet has moved to Github.

  1. // Programmatically logs out the current user
  2. global $user;
  3. $tmp = NULL;
  4. user_module_invoke('logout', $tmp, $user);
  5. $user = drupal_anonymous_user();

Report this snippet  


RSS Icon Subscribe to comments
Posted By: ishener on February 1, 2012

thank you, this really helped me!

You need to login to post a comment.