Initialize the session manager.

Invoking this function multiple times will reset the manager itself
and purge any handlers already registered with the system.

@return Manager
770379
public static function initialize()
    {
        $manager = self::$manager = new self();
        $manager->seedHandlerStack();

        session_set_save_handler($manager);

        return $manager;
    }
277952
public function clear()
    {
        if ( ! $this->isOpened()) {
            $this->start();
        }
        session_destroy();
        $this->is_opened = false;
        return $this;
    }
1082443
@Override
	public synchronized void initialize(Manager manager) {
		if (this.manager != null) {
			throw new IllegalStateException("Callback was already initialized");
		}
		this.manager = manager;
		for (Callback callback : callbacks) {
			try {
				callback.initialize(manager);
			} catch (Exception e) {
				onManagerWarning("Callback initialization error", e);
			}
		}
	}
77354
public function getSession()
    {
        $sessionKey = $this->getSessionKey();

        return $this->sessionManager->has($sessionKey) ? $this->sessionManager->get($sessionKey) : new Collection;
    }
407117
public function regenerate(): SessionId
    {
        $this->id = $this->create();
        $this->response->addCookie(
                Cookie::create($this->sessionName, $this->id)->forPath('/')
        );
        return $this;
    }
1349676
protected function _startSession()
    {
        $name     = md5($this->getCfg('secret') . get_class($this));
        $lifetime = $this->getCfg('lifetime') * 60 ;
        $handler  = $this->getCfg('session_handler', 'none');

        $options = array(
            'name' => $name,
            'expire' => $lifetime
        );

        $session = JSession::getInstance($handler, $options);
        $session->initialise($this->input, $this->dispatcher);

        if ($session->getState() == 'expired') {
            $session->restart();
        } else {
            $session->start();
        }

        return $session;
    }
805557
final public function init() {
		if ($this->request_initted)
			return;
		$this->init_request();
		if ($this->auto_shutdown)
			register_shutdown_function([$this, 'shutdown']);
		$this->request_initted = true;
		return $this;
	}
866430
public function reset()
    {
        $this->hashHandler = null;
        $this->bodyCanonIgnoreStart = 2;
        $this->bodyCanonEmptyCounter = 0;
        $this->bodyCanonLastChar = null;
        $this->bodyCanonSpace = false;

        return $this;
    }
1116257
public static function getSession()
    {
        if (CNabuHTTPSession::$nb_session === null) {
            CNabuHTTPSession::$nb_session = new CNabuHTTPSession();
            CNabuHTTPSession::$nb_session->init();
        }

        return CNabuHTTPSession::$nb_session;
    }
1291490
public function manager()
    {
        if (!isset($this->manager)) {
            $this->manager = new Manager($this->client);
        }

        return $this->manager;
    }
574882
public function reset()
	{
		unset($this->_registry);
		unset($this->_mixin);
		unset($this->_errorHandler);
		unset($this->_errorContext);
		unset($this->_middleware);
		return $this;
	}
100355
public static function initialize()
    {
        if (!isset($GLOBALS['_SESSION']) or !($GLOBALS['_SESSION'] instanceof self)) {
            $GLOBALS['_SESSION'] = self::getInstance();
        }

        return self::getInstance();
    }
414420
public static function getSessionHandler() {
        $sessionDriver = get_config('session_driver');
        
        self::$sessionDriver = $sessionDriver ? $sessionDriver : 'native';

        if (self::$sessionDriver) {
            switch (self::$sessionDriver) {
                case 'native':
                    self::$sessionHandler = new Session(get_config('session_timeout'));
                    break;
                case 'database':
                    self::$sessionHandler = new DbSession(get_config('session_timeout'));
                    break;
            }
        }

        if (self::$sessionHandler) {
            return self::$sessionHandler;
        } else {
            throw new \Exception(ExceptionMessages::MISCONFIGURED_SESSION_HANDLER);
        }
    }
321776
public static function init()
    {
        $c = new Configuration();
        $cc = $c->from('app')->get('session');

        if (strtolower($cc) == 'session') {
            return new Session();
        } elseif (strtolower($cc) == 'file') {
            return new File();
        } elseif (strtolower($cc) == 'cookie') {
            return new Cookie();
        } else {
            throw new \Exception($cc.' is not a supported session type!');
        }
    }
1238939
public function initializeState()
	{
		if (Session::has($this->session_key))
		{
			$this->setStateArray( Session::get($this->session_key) );
		}
		else
		{
			$this->resetState();
		}
		return $this->getStateArray();
	}
154457
public function initialize()
    {
        $request = $this->router->getAction();

        $isRouteCallback = $this->processRequestParameters($request);

        $this->start($isRouteCallback);

        return $this;
    }
1358784
public function initialize()
    {
        $driver = $this->_class;

        if (empty($driver)) {
            throw new Exception\InvalidArgumentException(
                "The session driver is invalid."
            );
        }

        // Load user defined driver
        if (class_exists($driver)) {
            $driverObj = new $driver($this->_options);
            if (is_a($driverObj, '\Slick\Session\Driver\DriverInterface')) {
                return $driverObj;
            } else {
                throw new Exception\InvalidArgumentException(
                    "The session type '{$driver}' doesn't inherited from "
                    ."Slick\Session\Driver\DriverInterface."
                );
            }
        }

        // Load module predefined drivers
        switch ($driver) {
            case 'server':
                $driverObj = new Driver\Server($this->_options);
                break;

            default:
                throw new Exception\InvalidArgumentException(
                    "The session type '{$driver}' isn't implemented."
                );
        }
       
        return $driverObj;
    }