<?php
function my_user_logout() {
watchdog('user', t('Session closed for %name.', array('%name' => $user->name)));
// Destroy the current session:
session_destroy();
module_invoke_all('user', 'logout', NULL, $user);
// Load the anonymous user
$user = drupal_anonymous_user();
drupal_goto('node');
}
?>