Create the cache based session handler instance.

@param  string  $driver
@return \Nova\Session\CacheBasedSessionHandler
496227
protected function createCacheHandler($driver)
    {
        $minutes = $this->app['config']['session.lifetime'];

        return new CacheBasedSessionHandler($this->app['cache']->driver($driver), $minutes);
    }
947708
public static function createInstance($driver, $options)
    {
        if(!in_array($driver, self::$_validDrivers)) {
            throw new \Exception("Driver '{$driver}' not implemented");
        }

        $class = __NAMESPACE__ . '\\Driver\\' . $driver;

        $driver = new $class;
        $driver->setOptions($options);

        return new Storage($driver);
    }
782196
public function setCache($cache)
    {
        if ($cache instanceof \Zend_Cache_Core) {
            $this->cache = $cache;
        } elseif ($cache instanceof \Zend_Config) {
            $this->cache = \Zend_Cache::factory($cache->toArray());
        } elseif (is_array($cache)) {
            $this->cache = \Zend_Cache::factory($cache);
        } else {
            throw new \Zend_Session_SaveHandler_Exception('Cache options must be in an associative array or instance of Zend_Config or Zend_Cache_Core.');
        }

        return $this;
    }
1077554
public function check($driver)
    {
        switch ($driver) {
            case self::DRIVER_MEMCACHE:
                return extension_loaded('memcache');
            case self::DRIVER_MEMCACHED:
                return extension_loaded('memcached');
        }
        return false;
    }
327032
protected function createDriver($driver)
    {
        $name = "orchestra.publisher.{$driver}";

        if (! $this->app->bound($name)) {
            throw new RuntimeException("Unable to resolve [{$driver}] publisher");
        }

        return $this->app->make($name);
    }
379804
public static function createInstance($driver, $options, $prefix = '')
    {
        if(!in_array($driver, self::$_validDrivers)) {
            throw new \Exception("Driver '{$driver}' not implemented");
        }

        $class = __NAMESPACE__ . '\\Driver\\' . $driver;

        $driver = new $class;
        $driver
            ->setOptions($options)
            ->setPrefix($prefix);

        return new Mcache($driver);
    }
736212
protected function createSessionDriver($name)
    {
        $config = Arr::get($this->config, "session.{$name}", []);
        return $this->createProvider(new Session($name, $config));
    }
404064
public function driver($driver = null)
    {
        $driver = $driver ?: $this->getDefaultDriver();

        if (is_null($driver)) {
            throw new InvalidArgumentException(sprintf('Unable to resolve NULL driver for [%s].', get_called_class()));
        }

        // If the given driver has not been created before, we will create the instances
        // here and cache it so we can return it next time very quickly. If there is
        // already a driver created by this name, we'll just return that instance.
        if (! isset($this->drivers[$driver])) {
            $this->drivers[$driver] = $this->createDriver($driver);
        }

        return $this->drivers[$driver];
    }
1107343
public function cache_driver()
	{
		if ( ! $this->_cache)
		{
			$adapter = new DCache_Adapter\File(
				realpath(__DIR__.'../../../'.static::CACHE_DIR)
			);
			$adapter->setOption('ttl', static::CACHE_LIFETIME);
			$this->_cache = new DCache\Cache($adapter);
		}

		return $this->_cache;
	}
257845
public function withSaveHandler(SessionHandlerInterface $save_handler): SessionMiddleware
    {
        return new SessionMiddleware(
            $save_handler,
            $this->name,
            $this->save_path,
            $this->cache_limiter,
            $this->cache_expire,
            $this->cookie_params
        );
    }
822957
protected function createDriver($driver): Contracts\Factory
    {
        if (\is_null($this->setupDriverConfig($driver))) {
            throw new InvalidArgumentException("Driver [$driver] not supported.");
        }

        return new $this->resolver($this->app, $this, $driver);
    }
53575
public function withCacheExpire(int $cache_expire): SessionMiddleware
    {
        return new SessionMiddleware(
            $this->save_handler,
            $this->name,
            $this->save_path,
            $this->cache_limiter,
            $cache_expire,
            $this->cookie_params
        );
    }
959305
protected function createNativeDriver()
    {
        $lifetime = $this->app['config']['session.lifetime'];

        return $this->buildSession(new FileSessionHandler(
            $this->app['files'], $this->app['config']['session.files'], $lifetime
        ));
    }
1200619
public function driver(AbstractDriver $driver = null)
    {
        if ($driver === null) {
            return $this->getDriver();
        }

        return $this->setDriver($driver);
    }
1332683
public function make(string $driver): ServiceDiscoverContract
    {
        $connections = $this->allConnections();

        switch ($driver) {
            case 'local':
                return new Local($this->app, $connections);
            case 'swarm':
                return new Swarm($this->app, $connections,
                    $this->app['client.manager'],
                    $this->app['cache']->store());
            case 'consul':
                return new Consul($this->app, $connections,
                    $this->app['client.manager'],
                    $this->app['cache']->store());
        }

        throw new InvalidArgumentException("Unsupported driver [{$driver}]");
    }
391221
private function getDriver(): \BearFramework\App\ICacheDriver
    {
        if ($this->driver !== null) {
            return $this->driver;
        }
        throw new \Exception('No cache driver specified! Use useAppDataDriver() or setDriver() to specify one.');
    }
686749
public function getSessionHandler(ContainerInterface $container): SessionHandlerInterface
    {
        $prefix = $container->get('ellipse.session.id.prefix');
        $ttl = $container->get('ellipse.session.ttl');
        $cache = $container->get('ellipse.session.cache');

        return new Psr6SessionHandler($cache, ['prefix' => $prefix, 'ttl' => $ttl]);
    }