/*
Private: Destroy all user sessions
494117
private function destroySessions()
    {
        $app = App::getInstance();

        $sql = $app['safesql']->query("UPDATE `login`
                SET valid = 0,
                logged_in = 0
                WHERE user='%s'
                AND session_name='%s'
                AND deleted = 0",
                array($this->getUser(), SESSION_NAME));

        return $app['db']->query($sql);
    }
981061
def destroy(id, options = {})
      custom_params = []
      custom_params << use_named_parameter('dc', options[:dc]) if options[:dc]
      raw = send_put_request(@conn, ["/v1/session/destroy/#{id}"], options, nil, custom_params)
      raw.body
    end
542937
public function kill_session()
    {
        $this->plugins->exec_hook('session_destroy');

        $this->session->kill();
        $_SESSION = array('language' => $this->user->language, 'temp' => true, 'skin' => $this->config->get('skin'));
        $this->user->reset();
    }
829581
public static function destroySessionIfNotAllowed(){
        if (!self::isAllowedSession() && ini_get("session.use_cookies") && session_status() == PHP_SESSION_ACTIVE) {
            $params = session_get_cookie_params();
            setcookie(session_name(), '', time() - 42000,
                $params["path"], $params["domain"],
                $params["secure"], $params["httponly"]
            );
        }
    }
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();
        }
    }
59464
private void destroySessionByToken(String id) {
		System.out.println(new LogEntry("destroying session " + id));
		synchronized (sessions) {
			synchronized (sessionsMirror) {
				StandardSession session = (StandardSession) sessions.get(id);
				if (session != null) {
					session.onDestruction();
					sessions.remove(id);
					sessionsMirror.remove(id);
				}
			}
		}
	}
796885
public function destroy()
    {
        $_SESSION = [];

        if (ini_get("session.use_cookies")) {
            $params = session_get_cookie_params();
            $time = time() - 42000;
            $path = $params['path'];
            $domain = $params['domain'];
            $secure = $params['secure'];
            $http = $params['httponly'];
            setcookie(session_name(), '', $time, $path, $domain, $secure, $http);
        }


        $this->container->remove('Session');

        session_destroy();
    }
910735
function destroy () {
                    $element.off('mousedown', handleMouseDown);
                    angular.element($window).off('mouseup', handleMouseUp);
                    angular.element($window).off('mousemove', handleMouseMove);
                }
578479
function(req, res) {
      waterlock.logger.debug('user logout');
      delete(req.session.user);

      if (req.session.authenticated) {
        this.logoutSuccess(req, res);
      } else {
        this.logoutFailure(req, res);
      }
    }
297929
public function cleanupSession()
    {
        if ($this->userSession) {
            $this->resetDriver();
            $this->createRequest('delete', "/user/sessions/{$this->userSession->sessionId}");
            $this->restDriver->setHeader('cookie', "{$this->userSession->sessionName}={$this->userSession->sessionId}");
            $this->restDriver->setHeader('x-csrf-token', $this->userSession->csrfToken);
            $this->sendRequest();
            $this->userSession = null;
        }
    }
427963
function() {
        for (var i=0, len=this.rules.length; i<len; i++) {
            this.rules[i].destroy();
        }
        delete this.rules;
    }
177395
public function destroySession()
    {
        if ($this->_is_session_initialized) {
            $_SESSION = array();
            if (isset($_COOKIE[$this->name])) {
                setcookie($this->name/*session_name()*/, '', time() - 42000, '/');
            }
            session_destroy();
            $this->_is_session_initialized = false;
        }
    }
387329
public static function clearSession(){
        session_destroy();
        self::$instance->invalidate();
        setcookie(self::$instance->getName(), self::$instance->getId(), time() - 3600 ,'/');
        return true;
    }
920246
public function destroy()
    {
        $this->security->destroy();
        $_SESSION = [];
        setcookie(session_name(), '', 1);
        unset($_COOKIE[session_name()]);
        session_destroy();
    }
21055
public function destroySession() {
        if (session_status() == PHP_SESSION_ACTIVE) {
            // unset all session variables
            $_SESSION = [];

            // delete the session cookie
            if (ini_get_bool('session.use_cookies')) {
                $params = session_get_cookie_params();
                setcookie($name=session_name(), $value='', $expire=time()-1*DAY, $params['path'    ],
                                                                                 $params['domain'  ],
                                                                                 $params['secure'  ],
                                                                                 $params['httponly']);
            }
            session_destroy();                      // TODO: check if SID is reset
        }
    }
1052325
public function destroy()
    {
        parent::destroy();

     Logger::get()->debug('Destroying user ' . $this->id);
        // If this user is the one stored in the session, destroy that too.
        if (!empty($_SESSION) && ($_SESSION['current_user'] == $this)) {
            unset($_SESSION['current_user']);
        }
    }
1255843
public function destroy() {
        if ($this->getId()) {
            // Clear all session variables
            $_SESSION = array();

            // Delete session cookie
            if (ini_get("session.use_cookies")) {
                $params = session_get_cookie_params();
                setcookie($this->getName(), '', time() - 42000,
                    $params["path"], $params["domain"],
                    $params["secure"], $params["httponly"]
                );
            }

            // Destroy session
            $this->destroySession();
        }
    }