Generate and set new session id

@param boolean $destroy If enabled the current session will be destroyed
@return bool
18121
public function regenerate_id($destroy=true)
    {
        session_regenerate_id($destroy);

        $this->vars = null;
        $this->key  = session_id();

        return true;
    }
725731
public static function set($key, $value = false)
    {

        /**
         * Check whether session is set in array or not
         * If array then set all session key-values in foreach loop
         */

        self::setPrefix();

        if (is_array($key) && $value === false) {

            foreach ($key as $name => $value) {
                $_SESSION[self::$_sessionPrefix . $name] = $value;
            }

        } else {
            $_SESSION[self::$_sessionPrefix . $key] = $value;
        }

    }
783088
public function destroy($reopen = false)
    {
        if ($this->isOpen) {
            $params = session_get_cookie_params();
            setcookie(
                session_name(),
                '',
                time() - 42000,
                $params['path'],
                $params['domain'],
                $params['secure'],
                $params['httponly']
            );
            session_destroy();
            $this->isOpen = false;
        }
        if ($reopen) {
            $this->open(null);
        }
    }
1318997
public function destroy()
  {
    if ($this->sessionState == self::SESSION_STARTED) {
      $_SESSION=array();
      $this->sessionState = !session_destroy();
      unset($_SESSION);
      return !$this->sessionState;
    }
    return FALSE;
  }
274437
public function destroy($id)
	{
		try
		{
			$query = $this->db->getQuery(true);
			$query->delete($this->db->quoteName('#__session'))
				->where($this->db->quoteName('session_id') . ' = ' . $this->db->quote($id));

			// Remove a session from the database.
			$this->db->setQuery($query);

			return (boolean) $this->db->execute();
		}
		catch (\Exception $e)
		{
			return false;
		}
	}
1301836
public function destroy($removeCookie = false)
    {
        if ($this->id) {
            if ($removeCookie) {
                $this->removeCookie();
            }
            $this->handler->destroy($this->id);
            $this->handler->close();
            $this->id = '';
            $this->data = null;
            return true;
        }
        return false;
    }
784616
protected function changeCurrentId($newId)
    {
        if (!preg_match('/^[-,a-zA-Z0-9]{1,128}$/', $newId)) {
            throw new InvalidArgumentException('Invalid Session ID String');
        }

        if (session_id($newId) === false) {
            throw new SessionRuntimeException('session_id Failed');
        }

        return true;
    }
318389
public function destroy($id)
    {
        // Note: Do NOT delete session data in $_SESSION variable or
        // session cookie here as this method is also called via
        // session_regenerate_id(true)

        // Delete session file on disk
        $file = $this->getPathForSessionId($id);
        if (file_exists($file)) {
            unlink($file);
        }

        return true;
    }
508261
final public function destroy($id = "")
    {

        $id = !empty($id) ? $id : $this->getId();
        $now = time();

        if (empty($id)) {
            return false;
        }

        setcookie(session_name(), '', $now - 42000, '/');

        if (session_id()) {
            @session_unset();
            @session_destroy();
        }

        //Delete from db;
        //Do a garbage collection
        $this->gc($id);
    }
318528
function delete() {
        global $DB;

        if ($this->deleted) {
            return true;
        }

        $this->delete_all_sessions();

        $this->deleted = 1;
        return $this->commit();
    }
615138
function delete()
    {

        if (!$this->exists()) {
            return false;
        }

        $this->newQuery()->id($this->getID())->delete();

        $this->exists = false;

        return $this;
    }
243344
private static function create_new_id(string $prefix = "Wedeto")
    {
        if (version_compare(PHP_VERSION, '7.1.0') > 0)
            return session_create_id($prefix);
        return $prefix . bin2hex(random_bytes(16));
    }
570914
public function create($name, $value = '')
    {
        $_SESSION[$name] = $value;

        if(isset($_SESSION[$name])) {

            return true;
        }

        return false;
    }
407117
public function regenerate(): SessionId
    {
        $this->id = $this->create();
        $this->response->addCookie(
                Cookie::create($this->sessionName, $this->id)->forPath('/')
        );
        return $this;
    }
1247291
public function destroySession ($id) {
        $this->_connection->getClient ()->delete ($this->calculateKey ($id));
        return true;
    }
1220196
public function destroy($key = false) {
        if ($key) {
            unset($this->_session->{$key});
        } else {
            $this->_session->unsetAll();
        }
        return $this;
    }
1267946
public static function set($name, $value)
    {
        return (self::has($name) !== true) ? $_SESSION[$name] = $value : false;
    }