Closes the session with the device.
514596
def logout(session, cookies, csrf_token):
    '''
    
    '''
    payload = {"jsonrpc": "2.0",
               "id": "ID0",
               "method": "logout",
               "params": []
               }
    session.post(DETAILS['url'],
                 data=json.dumps(payload),
                 cookies=cookies,
                 headers={'X-CSRF-Token': csrf_token})
1301163
@Override
  public void stopSession() {
    serverInstrumentation.finishAllActivities();
    this.activeWindowType = WindowType.NATIVE_APP.name();
    this.session = null;
    nativeSearchScope = null;
    selendroidNativeDriver = null;
    selendroidWebDriver = null;
    webviewSearchScope = null;
  }
1145282
public void close()
    {
        inputManager.unregisterInputDeviceListener(inputDeviceListener);
        mouseDeviceManager.forceStopThread();
        gamepadDeviceManager.forceStopThread();
        controllerIds.clear();
        cache.clear();
        controllers.clear();
    }
1127360
public void close() {
        synchronized (sessions) {
            closed = true;
            sessionCleaner.close();
            sessions.stream().forEach(PooledSession::reallyClose);
        }
    }
390981
@Override
	public final void onSessionClosed(Session session) {
		this.hsClient.getConnector().removeSession(session);
		HandlerSocketSession hSession = (HandlerSocketSession) session;

		hSession.destroy();
		if (this.hsClient.getConnector().isStarted()
				&& hSession.isAllowReconnect()) {
			this.reconnect(session);
		}
		for (HSClientStateListener listener : this.hsClient
				.getHSClientStateListeners()) {
			listener.onDisconnected(this.hsClient, session
					.getRemoteSocketAddress());
		}
	}
997528
public void disconnect() {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Disconnecting client for session: 0x"
                    + Long.toHexString(getSessionId()));
        }

        sendThread.close();
        eventThread.queueEventOfDeath();
    }
169440
def close_session(self):
        """"""
        if not self._session.closed:
            if self._session._connector_owner:
                self._session._connector.close()
            self._session._connector = None
582759
public void disconnect() throws IOException {
        if (currentSession != null && currentSession.isOpen()) {
            synchronized (currentSession) {
                this.currentSession.close(new CloseReason(
                        CloseReason.CloseCodes.NORMAL_CLOSURE,
                        RTMClient.class.getCanonicalName() + " did it"
                ));
            }
        }
    }
13516
protected final void closeSessionAndClearTokenInformation() {
        if (sessionTracker != null) {
            Session currentSession = sessionTracker.getOpenSession();
            if (currentSession != null) {
                currentSession.closeAndClearTokenInformation();
            }
        }
    }
971471
def close(self):
        """"""
        if self.session is not None:
            self.session.cookies.clear()
            self.session.close()
            self.session = None
982176
def close(self):
        
        self.sasl.mechanism.destroy()
        self.sasl_client.get_client().destroy()
        self._underlying_xio.destroy()
1338691
def close(self):
        
        self._execute_plugin_hooks_sync(hook='close')

        if not self.session.closed:
            ensure_future(self.session.close(), loop=self.loop)
520375
def close(self):
        
        if getattr(self, '_connection', None):
            logger.debug('Closing sqlite connection.')
            self._connection.close()
            self._connection = None
1370055
protected void close() {
        guard.close();

        if (fd != null) {
            datagramSocketClose();
            ResourceManager.afterUdpClose();
            fd = null;
        }
    }
117642
def close(self):
        
        self._serial.write(b"@c")
        self._serial.read()
        self._serial.close()
449583
@Override
    public void close() {
        if (isClosed) {
            return;
        }

        TransactionOLTP localTx = localOLTPTransactionContainer.get();
        if (localTx != null) {
            localTx.close(ErrorMessage.SESSION_CLOSED.getMessage(keyspace()));
            localOLTPTransactionContainer.set(null);
        }

        if (this.onClose != null) {
            this.onClose.accept(this);
        }

        isClosed = true;
    }
514402
def close_session(self, commit=True):
        
        if self._session is not None:
            if commit:
                self._session.commit()
            self._session.close()
            self._session = None