function drupal_session_destroy_uid

drupal_session_destroy_uid($uid)

Ends a specific user's session(s).

Parameters

$uid: User ID.

File

includes/session.inc, line 479
User session handling functions.

Code

function drupal_session_destroy_uid($uid) {
  // Nothing to do if we are not allowed to change the session.
  if (!drupal_save_session()) {
    return;
  }

  db_delete('sessions')
    ->condition('uid', $uid)
    ->execute();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!session.inc/function/drupal_session_destroy_uid/7.x