shutdown

Shutdown and remove sessions from the service. If no arguments are
given, all the instantiated sessions are shutdown. Otherwise, only given
sessions are shutdown.

@param  array $session_names
@return Pomm  $this
164414
public function shutdown(array $session_names = [])
    {
        if (empty($session_names)) {
            $sessions = array_keys($this->sessions);
        } else {
            array_map([ $this, 'builderMustExist' ], $session_names);
            $sessions = array_intersect(
                array_keys($this->sessions),
                $session_names
            );
        }

        foreach ($sessions as $session_name) {
            $this->getSession($session_name)->shutdown();
            $this->removeSession($session_name);
        }

        return $this;
    }
1318997
public function destroy()
  {
    if ($this->sessionState == self::SESSION_STARTED) {
      $_SESSION=array();
      $this->sessionState = !session_destroy();
      unset($_SESSION);
      return !$this->sessionState;
    }
    return FALSE;
  }
860112
public function destroy()
	{
		// do we have something to destroy?
		if ( ! empty($this->keys))
		{
			// delete the key from the redis server
			$this->redis->del($this->keys['session_id']);
		}

		parent::destroy();

		return $this;
	}
800297
public function remove($name)
    {
        //argument 1 must be a string
        Argument::i()->test(1, 'string');

        if (isset($_SESSION[$name])) {
            unset($_SESSION[$name]);
        }

        return $this;
    }
26860
public function shutdown()
    {

        // create a local copy of the request/response
        $servletRequest = $this->servletRequest;
        $servletResponse = $this->servletResponse;

        // check if we had a fatal error that caused the shutdown
        if ($lastError = error_get_last()) {
            // add the fatal error
            $this->addError(ErrorUtil::singleton()->fromArray($lastError));
            // in case of fatal errors, we need to override request with perpared
            // instances because error handling needs application access
            $servletRequest = RequestHandler::$requestContext;
        }

        // handle the errors if necessary
        ErrorUtil::singleton()->handleErrors($this, $servletRequest, $servletResponse);

        // copy request/response back to the thread context
        $this->servletRequest = $servletRequest;
        $this->servletResponse = $servletResponse;
    }
1283370
protected function stopSession()
	{
		if ( $this->_session === null ) {
			return;
		}

		$this->_session->stop();
		$this->_session = null;
	}
132328
public function logoutSession()
    {
        $url = $this->serverUrl . "/logout.html";
        $this->restReq->prepAndSend($url, array(302), 'GET');     // Kill server session
        $this->restReq->closeCurlHandle(true);                    // cleanup client resources
    }
281106
@Override
  public void shutdown(ShutdownModeAmp mode)
  {
    TreeSet<String> serviceNames = new TreeSet<>(_serviceMap.keySet());
    
    // HashSet<ServiceRefAmp> serviceSet = new HashSet<>(_serviceMap.values());
    
    if (mode == ShutdownModeAmp.GRACEFUL) {
      save(serviceNames);
    }
    
    for (String serviceName : serviceNames) {
      try {
        ServiceRefAmp serviceRef = _serviceMap.get(serviceName);
        
        serviceRef.shutdown(mode);
      } catch (Throwable e) {
        log.log(Level.FINE, e.toString(), e);
      }
    }
  }
1277438
public function clear(): SessionInterface
    {
        $values = $this->getAll();

        if (count($values) > 0) {
            $this->delete(...array_keys($values));
        }

        return $this;
    }
1237500
public static function shutdown_handler($errors = false, $handled = false)
    {
        if ($handled) {
            self::flush();
        }

        if ($errors === true && ($error = error_get_last()) && !$handled) {
            self::error_handler($error["type"], $error["message"], $error["file"], $error["line"]);
        }

        if (!$handled) {
            self::flush();
        }

        if (session_id() != '') {
            session_write_close();
        }

        exit;
    }
1332733
public function destroy($session_id = null)
    {
        if ($session_id) {
            $this->eventsManager->fireEvent('session:destroy', $this, ['session_id' => $session_id]);
            $this->do_destroy($session_id);
        } else {

            $context = $this->_context;

            if (!$context->started) {
                $this->_start();
            }

            $this->eventsManager->fireEvent('session:destroy', $this, ['session_id' => $session_id, 'context' => $context]);

            $context->started = false;
            $context->is_dirty = false;
            $context->session_id = null;
            $context->_SESSION = null;
            $this->do_destroy($context->session_id);

            $params = $this->_cookie_params;
            $this->cookies->delete($this->_name, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
        }
    }
1281597
public function shutdown()
    {
        foreach ($this->shutdown_functions as $function) {
            call_user_func($function);
        }

        // write session data as soon as possible and before
        // closing database connection, don't do this before
        // registered shutdown functions, they may need the session
        // Note: this will run registered gc handlers (ie. cache gc)
        if ($_SERVER['REMOTE_ADDR'] && is_object($this->session)) {
            $this->session->write_close();
        }

        if (is_object($this->smtp)) {
            $this->smtp->disconnect();
        }

        foreach ($this->caches as $cache) {
            if (is_object($cache)) {
                $cache->close();
            }
        }

        if (is_object($this->storage)) {
            $this->storage->close();
        }

        if ($this->config->get('log_driver') == 'syslog') {
            closelog();
        }
    }
200756
public function clear($name)
	{
		if ($this->_state !== self::STATE_ACTIVE) {
			throw new LibSessionsException("Session isn't active!\n");
		}

		$value = null;

		if (isset($_SESSION[$this->_namespace][$name])) {
			$value = $_SESSION[$this->_namespace][$name];
			unset($_SESSION[$this->_namespace][$name]);
		}

		return $value;
	}
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
        }
    }
282088
public function close($name = null)
    {
        if (null === $name) {
            $name = $this->current ?: 'default';
        }

        if (isset($this->connections[$name])) {
            unset($this->connections[$name]);
        }
    }
937785
public function destroy($session_id)
	{
		$key = $this->key($session_id);

		$this->engine->delete($key . '_expire');

		return $this->engine->delete($key);
	}
777831
public static function delete($name)
    {
        empty(self::$init) && self::init();

        $session = self::get($name);
        if (is_string($session)) {
            unset($_SESSION[$name]);
        }

        if (is_array($session)) {
            $_SESSION[$name] = [];
        }
        return true;
    }