You are here

function tokenauth_exit in Token authentication 6

Same name and namespace in other branches
  1. 5 tokenauth.module \tokenauth_exit()
  2. 6.2 tokenauth.module \tokenauth_exit()
  3. 7 tokenauth.module \tokenauth_exit()

Implementation of hook_exit(). Deliberately insure that this session will not be saved by sess_write(). Safety.

See also

user_logout

File

./tokenauth.module, line 120

Code

function tokenauth_exit() {
  global $user;
  if (isset($_SESSION['tokenauth_auth'])) {

    // Destroy the current session:
    session_destroy();

    // Load the anonymous user
    $user = drupal_anonymous_user();
  }
}