You are here

function shib_auth_terminate_session in Shibboleth Authentication 6.4

Same name and namespace in other branches
  1. 7.4 shib_auth.module \shib_auth_terminate_session()

Unset session variables and destroy them

Parameters

msg Error Message:

2 calls to shib_auth_terminate_session()
shib_auth_init in ./shib_auth.module
Create a new user based on informations from the Shibboleth handler if it's necessary or log in.
shib_auth_session_check in ./shib_auth.module
This function would destroy the session if

File

./shib_auth.module, line 139
Drupal Shibboleth authentication module.

Code

function shib_auth_terminate_session($msg = '') {
  global $user;

  // unset all session variables and destroy session
  if (isset($user->uid)) {
    sess_destroy_uid($user->uid);
  }
  $_SESSION = array();
  if ($msg) {
    shib_auth_error($msg);
  }
  session_destroy();
  $user = drupal_anonymous_user();
}