Return to Snippet

Revision: 35201
at November 4, 2010 02:32 by wildpeaks


Initial Code
// Programmatically logs out the current user
global $user;
$tmp = NULL;
session_destroy();
user_module_invoke('logout', $tmp, $user);
$user = drupal_anonymous_user();

Initial URL

                                

Initial Description
**Important: this snipplet has moved to Github.**

 - [Programmatically log out the user in Drupal](https://gist.github.com/1973079)

Initial Title
Drupal: programmatically log out the user

Initial Tags
drupal

Initial Language
PHP