Delete selected sessions.
964507
def action_delete(self, ids):
        """"""
        is_current = any(SessionActivity.is_current(sid_s=id_) for id_ in ids)
        if is_current:
            flash('You could not remove your current session', 'error')
            return
        for id_ in ids:
            delete_session(sid_s=id_)
        db.session.commit()
730901
public void removeSession(Session session) {
		InetSocketAddress remoteSocketAddress = session
				.getRemoteSocketAddress();
		log.warn("Remove a session: "
				+ SystemUtils.getRawAddress(remoteSocketAddress) + ":"
				+ remoteSocketAddress.getPort());
		this.sessionList.remove(session);
	}
850838
def remove_session(self, session):
        
        try:
            del session.redis
        except AttributeError:
            pass
        try:
            del session.index_new[self.cls_name]
            del session.index_dirty[self.cls_name]
            del session.index_deleted[self.cls_name]
        except (AttributeError, KeyError):
            log.warning('Removing a session that has no indexing sets.')
        self.sessions.remove(session)
847146
public void destroyAllSessions ()
  {
    // destroy all session scopes (use a copy, because we're invalidating
    // the sessions internally!)
    for (final ISessionScope aSessionScope : getAllSessionScopes ())
    {
      // Unfortunately we need a special handling here
      if (aSessionScope.selfDestruct ().isContinue ())
      {
        // Remove from map
        onScopeEnd (aSessionScope);
      }
      // Else the destruction was already started!
    }

    // Sanity check in case something went wrong
    _checkIfAnySessionsExist ();
  }
418109
public void clear() {
        this.attributes.clear();
        this.queryParameters = null;
        this.inReader = null;
        this.streamActive = false;
        this.inStream = null;
        this.encoding = null;
        this.sessionData = null;
        this.strippedURI = null;
        this.srvContext = null;
        this.srvPath = null;
        this.pathInfo = null;
        this.pathInfoComputed = false;
        this.filters = null;
    }
938522
public static function delete()
    {
        // Loop all arguments
        foreach (func_get_args() as $argument) {

            // Array element
            if (is_array($argument)) {

                // Loop the keys
                foreach ($argument as $key) {

                    // Unset session key
                    unset($_SESSION[(string) $key]);
                }
            } else {

                // Remove from array
                unset($_SESSION[(string) $argument]);
            }
        }
    }
1329883
def destroy(cls, *ids):
        
        for pk in ids:
            cls.find(pk).delete()
        cls.session.flush()
865021
public synchronized void closeAllSessions() {

        // don't disconnect system user; need it to save database
        Session[] sessions = getAllSessions();

        for (int i = 0; i < sessions.length; i++) {
            sessions[i].close();
        }
    }
1213040
public function handleClearSessions(): void
	{
		$this->checkHandlerPermission();

		$this->app->clearSession('0 minute');
		$this->flashNotifier->success('dockbar.management.application.sessionsCleared');
	}
227484
def remove(self, safe=None):
        
        self._session.remove(self, safe=None)
        self._session.flush()
1026111
public void removeAllSessions() {		
		List<SipSessionKey> sipSessionsToRemove = new ArrayList<SipSessionKey>(); 
		for (SipSessionKey sipSessionKey : sipSessions.keySet()) {
			sipSessionsToRemove.add(sipSessionKey);
		}
		for (SipSessionKey sipSessionKey : sipSessionsToRemove) {
			removeSipSession(sipSessionKey);
		}
		List<SipApplicationSessionKey> sipApplicationSessionsToRemove = new ArrayList<SipApplicationSessionKey>(); 
		for (SipApplicationSessionKey sipApplicationSessionKey : sipApplicationSessions.keySet()) {
			sipApplicationSessionsToRemove.add(sipApplicationSessionKey);
		}
		for (SipApplicationSessionKey sipApplicationSessionKey : sipApplicationSessionsToRemove) {
			removeSipApplicationSession(sipApplicationSessionKey);
		}				
	}
1178379
def clear(self):
        """"""

        r = self._h._http_resource(
            method='DELETE',
            resource=('user', 'keys'),
        )

        return r.ok
235401
def delete(self, db_session=None):
        
        db_session = get_db_session(db_session, self)
        db_session.delete(self)
961599
def discard_config(self):
        """"""
        if self.config_session is not None:
            commands = []
            commands.append('configure session {}'.format(self.config_session))
            commands.append('abort')
            self.device.run_commands(commands)
            self.config_session = None
926982
@Handler(channels = Channel.class)
    public void discard(DiscardSession event) {
        removeSession(event.session().id());
    }
985760
def deleteSelected(self):
        ''
        ndeleted = self.deleteBy(self.isSelected)
        nselected = len(self._selectedRows)
        self._selectedRows.clear()
        if ndeleted != nselected:
            error('expected %s' % nselected)
1129526
def revoke_session():
    """"""
    form = RevokeForm(request.form)
    if not form.validate_on_submit():
        abort(403)

    sid_s = form.data['sid_s']
    if SessionActivity.query.filter_by(
            user_id=current_user.get_id(), sid_s=sid_s).count() == 1:
        delete_session(sid_s=sid_s)
        db.session.commit()
        if not SessionActivity.is_current(sid_s=sid_s):
            # if it's the same session doesn't show the message, otherwise
            # the session will be still open without the database record
            flash('Session {0} successfully removed.'.format(sid_s), 'success')
    else:
        flash('Unable to remove the session {0}.'.format(sid_s), 'error')
    return redirect(url_for('invenio_accounts.security'))