original_string: public static function logout_db_session($spsessionid) {
          global $CFG, $DB;
  
          $sessions = $DB->get_records_sql(
              'SELECT userid, sessdata FROM {sessions} WHERE timemodified > ?',
              array(time() - $CFG->sessiontimeout)
          );
  
          foreach ($sessions as $session) {
              // Get user session from DB.
              if (session_decode(base64_decode($session->sessdata))) {
                  if (isset($_SESSION['SESSION']) && isset($_SESSION['SESSION']->shibboleth_session_id)) {
                      // If there is a match, kill the session.
                      if ($_SESSION['SESSION']->shibboleth_session_id == trim($spsessionid)) {
                          // Delete this user's sessions.
                          \core\session\manager::kill_user_sessions($session->userid);
                      }
                  }
              }
          }
      }
code: public static function logout_db_session($spsessionid) {
          global $CFG, $DB;
  
          $sessions = $DB->get_records_sql(
              'SELECT userid, sessdata FROM {sessions} WHERE timemodified > ?',
              array(time() - $CFG->sessiontimeout)
          );
  
          foreach ($sessions as $session) {
              // Get user session from DB.
              if (session_decode(base64_decode($session->sessdata))) {
                  if (isset($_SESSION['SESSION']) && isset($_SESSION['SESSION']->shibboleth_session_id)) {
                      // If there is a match, kill the session.
                      if ($_SESSION['SESSION']->shibboleth_session_id == trim($spsessionid)) {
                          // Delete this user's sessions.
                          \core\session\manager::kill_user_sessions($session->userid);
                      }
                  }
              }
          }
      }
code_tokens: public static function logout_db_session ( $ spsessionid ) { global $ CFG , $ DB ; $ sessions = $ DB -> get_records_sql ( 'SELECT userid, sessdata FROM {sessions} WHERE timemodified > ?' , array ( time ( ) - $ CFG -> sessiontimeout ) ) ; foreach ( $ sessions as $ session ) { // Get user session from DB. if ( session_decode ( base64_decode ( $ session -> sessdata ) ) ) { if ( isset ( $ _SESSION [ 'SESSION' ] ) && isset ( $ _SESSION [ 'SESSION' ] -> shibboleth_session_id ) ) { // If there is a match, kill the session. if ( $ _SESSION [ 'SESSION' ] -> shibboleth_session_id == trim ( $ spsessionid ) ) { // Delete this user's sessions. \ core \ session \ manager :: kill_user_sessions ( $ session -> userid ) ; } } } } }
docstring: Delete session of user using DB sessions.
  
  @param string $spsessionid SP-provided Shibboleth Session ID
docstring_tokens: Delete session of user using DB sessions .