init session handler

@throws SessionException
549820
public function init()
    {
        session_set_save_handler($this->getDriver(), false);
        $this->setOptions($this->config->all());
        session_start();
    }
1198706
public function handleRegenerate()
    {
        // check for invalid call
        if (!$this->wasStarted()) {
            throw new Doozr_Session_Service_Exception(
                'Error while handling Session regeneration! handleRegenerate() must be called after session start().'
            );
        }

        // check if session must be regenerated
        if (($currentCycle = $this->mustRegenerate()) === true) {
            // do regenerate
            $this->regenerate();

            // reset cycle count cause after regenerate we start from scratch
            $currentCycle = 0;
        }

        // store current cycle count in session
        $this->set(self::DEFAULT_REGENERATE_CYCLES_IDENTIFIER, $currentCycle);
    }
344802
public function init()
	{
		// generic driver initialisation
		parent::init();

		if ($this->memcached === false)
		{
			// do we have the PHP memcached extension available
			if ( ! class_exists('Memcached') )
			{
				throw new \FuelException('Memcached sessions are configured, but your PHP installation doesn\'t have the Memcached extension loaded.');
			}

			// instantiate the memcached object
			$this->memcached = new \Memcached();

			// add the configured servers
			$this->memcached->addServers($this->config['servers']);

			// check if we can connect to the server(s)
			if ($this->memcached->getVersion() === false)
			{
				throw new \FuelException('Memcached sessions are configured, but there is no connection possible. Check your configuration.');
			}
		}
	}
1220885
public function initSession()
    {
        if (php_sapi_name() != 'cli') {
        
            if (!isset($_COOKIE['ccms'])) {
                $this->_uid = md5($_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT'].rand());
            } else {
                $a = explode('.', $_COOKIE['ccms']);
                $this->_uid = $a[0];
                $this->_last_visit = $a[1];
            }
            setcookie('ccms',$this->_uid.'.'.time(),time()+REMEMBER_ME_SECONDS,'/');
            
        }
        
        \Zend_Session::setSaveHandler(new SessionSaveHandler());
                             
        $this->_session = new \Zend_Session_Namespace(SESSION_NAMESPACE);
        
        if (isset($this->_session->locale) && $this->_session->locale) {
            $this->_locale->setLocale($this->_session->locale);
        }
    }
351879
function init(){

    eventDataPairs = 0;
    currentSession = sessionManager.createSession();
    lastRequestTime = utils.getUnixTimeInSeconds();
    mediaPlaying = false;

    // checks if time since last request has exceeded the maximum request time
    if (timeSinceRequestChecker){

        clearInterval(timeSinceRequestChecker);
        timeSinceRequestChecker = null;

    }

    timeSinceRequestChecker = setInterval(
        () => {
            const currentTime = utils.getUnixTimeInSeconds();
            if (currentTime - lastRequestTime > config.getDataPostTimeInterval()){

                _createDataRequest();

            }
        }, 
        1000);

}
1297970
public function init()
    {
        parent::init();
        $this->sessionKey = $this->getSessionKey();
        $this->cache = Instance::ensure($this->cache, Cache::class);
    }
578725
private Object init(Object[] arguments) throws PageException {
	object = Reflector.callConstructor(clazz, arguments);
	isInit = true;
	return object;
    }
813335
private function initialize()
    {
        $this->name = (isset($this->configurations['name']))
            ? $this->configurations['name']
            : self::DEFAULT_SESSION_NAME;
        $this->assignSessionLifetime();
        if (isset($this->configurations['encryption_enabled'])
            && $this->configurations['encryption_enabled']) {
            $this->handler = new EncryptedSessionHandler();
        }
        $this->security = new SecuritySession($this->configurations);
    }
816381
private function setSessionHandler()
    {
        $vitex = Vitex::getInstance();
        $driver = $vitex->getConfig('session.driver');
        switch ($driver){
            case 'cache':
                session_set_save_handler(new CacheHandler(),true);
                break;
            case 'file':
                session_set_save_handler(new FileHandler(),true);
                break;
        }
    }
992668
public function initialize()
    {
        if (false === $this->initialized) {
            if (!$this->container) {
                throw new Exception('A container object is required to access the \'session\' service.');
            }

            $this->session = $this->container->get('session');
            $this->data = $this->session->get($this->name, []);

            $this->initialized = true;
        }
    }
1081063
public function session_init()
    {
        // session started (Installer?)
        if (session_id()) {
            return;
        }

        $sess_name   = $this->config->get('session_name');
        $sess_domain = $this->config->get('session_domain');
        $sess_path   = $this->config->get('session_path');
        $lifetime    = $this->config->get('session_lifetime', 0) * 60;
        $is_secure   = $this->config->get('use_https') || rcube_utils::https_check();

        // set session domain
        if ($sess_domain) {
            ini_set('session.cookie_domain', $sess_domain);
        }
        // set session path
        if ($sess_path) {
            ini_set('session.cookie_path', $sess_path);
        }
        // set session garbage collecting time according to session_lifetime
        if ($lifetime) {
            ini_set('session.gc_maxlifetime', $lifetime * 2);
        }

        // set session cookie lifetime so it never expires (#5961)
        ini_set('session.cookie_lifetime', 0);
        ini_set('session.cookie_secure', $is_secure);
        ini_set('session.name', $sess_name ?: 'roundcube_sessid');
        ini_set('session.use_cookies', 1);
        ini_set('session.use_only_cookies', 1);
        ini_set('session.cookie_httponly', 1);

        // get session driver instance
        $this->session = rcube_session::factory($this->config);
        $this->session->register_gc_handler(array($this, 'gc'));

        // start PHP session (if not in CLI mode)
        if ($_SERVER['REMOTE_ADDR']) {
            $this->session->start();
        }
    }
172067
protected void init()
    {
        // "support for SSL"
        String handlerPkgs = System.getProperty("java.protocol.handler.pkgs");
        if ((handlerPkgs != null) && !(handlerPkgs.isEmpty())) {
            handlerPkgs = handlerPkgs + "|com.sun.net.ssl.internal.www.protocol";
        } else {
        	handlerPkgs = "com.sun.net.ssl.internal.www.protocol";
        }
        System.setProperty("java.protocol.handler.pkgs", handlerPkgs);

        java.security.Security
                .addProvider(new com.sun.net.ssl.internal.ssl.Provider());

        // Create custom EditorKit if needed
        if (swingBoxEditorKit == null) {
            swingBoxEditorKit = new SwingBoxEditorKit();
        }

        setEditable(false);
        setContentType("text/html");

        activateTooltip(true);

        Caret caret = getCaret();
        if (caret instanceof DefaultCaret)
        	((DefaultCaret) caret).setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
    }
1320889
protected function startSession()
    {
        if (@session_status() === \PHP_SESSION_ACTIVE) {
            throw new SessionNotStartedException('Session started already!');
        }

        if (ini_get('session.use_cookies') && headers_sent($file, $line)) {
            throw new SessionNotStartedException(sprintf('Unable to start session, headers already sent by "%s" at line %d.', $file, $line));
        }

        $this->setSessionConfig();

        /*
         | We will start session, if fails
         | we will throw exception to user
         */
        if (!session_start()) {
            throw new SessionNotStartedException('Unable to start session');
        }
    }
1162646
private function loadSession() {

		$session = &$_SESSION;
		
		$this->sessionDataBag->initialize($session);

		$this->started = TRUE;

	}
364636
protected synchronized void doStart()
        throws Exception
    {
        if (isStarted())
            return;
        
        _contextLog = LogFactory.getLog("org.browsermob.proxy.jetty.jetty.context."+getHttpContext().getHttpContextName());
        
        if (_contextLog==null)
            _contextLog=log;
        
        if (_sessionManager!=null)
            _sessionManager.start();
        
        // Initialize classloader
        _loader=getHttpContext().getClassLoader();

        if (_autoInitializeServlets)
            initializeServlets();
    }
223570
public function initializeManager()
    {
        $handlers = $this->handlerObjectBackend->loadObject();
        if (!is_array($handlers)) {
            $handlers = array();
        }
        
        $this->handlers = $handlers;
    }
1056621
public static function _init()
	{
		\Config::load('session', true);

		if (\Config::get('session.auto_initialize', true))
		{
			static::instance();
		}

		if (\Config::get('session.native_emulation', false))
		{
			// emulate native PHP sessions
			session_set_save_handler (
				// open
				function ($savePath, $sessionName) {
				},
				// close
				function () {
				},
				// read
				function ($sessionId) {
					// copy all existing session vars into the PHP session store
					$_SESSION = \Session::get();
					$_SESSION['__org'] = $_SESSION;
				},
				// write
				function ($sessionId, $data) {
					// get the original data
					$org = isset($_SESSION['__org']) ? $_SESSION['__org'] : array();
					unset($_SESSION['__org']);

					// do we need to remove stuff?
					if ($remove = array_diff_key($org, $_SESSION))
					{
						\Session::delete(array_keys($remove));
					}

					// add or update the remainder
					empty($_SESSION) or \Session::set($_SESSION);
				},
				// destroy
				function ($sessionId) {
					\Session::destroy();
				},
				// gc
				function ($lifetime) {
				}
			);
		}
	}