Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Created March 4, 2012 13:47
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cecilemuller/1973079 to your computer and use it in GitHub Desktop.
Programmatically log out the user in Drupal 6
<?php
global $user;
$tmp = NULL;
session_destroy();
user_module_invoke('logout', $tmp, $user);
$user = drupal_anonymous_user();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment