create a new session

@access	public
@return	Fuel\Core\Session_Memcached
199279
public function create()
	{
		// create a new session
		$this->keys['session_id']	= $this->_new_session_id();
		$this->keys['previous_id']	= $this->keys['session_id'];	// prevents errors if previous_id has a unique index
		$this->keys['ip_hash']		= md5(\Input::ip().\Input::real_ip());
		$this->keys['user_agent']	= \Input::user_agent();
		$this->keys['created'] 		= $this->time->get_timestamp();
		$this->keys['updated'] 		= $this->keys['created'];

		return $this;
	}
40262
public static function 
    {

        if (self::$memcached) {
            return;
        }

        self::$memcached = new \Memcached();

        foreach (self::$config['memcached']['servers'] as $server) {
            extract(array_merge(self::$memcachedServerDefaults, $server));

            self::$memcached->addServers($host, $port, $persistent, $weight, $timeout);
        }
    }
344444
protected function createMemcachedDriver()
    {
        $servers = $this->app['config']['cache.memcached'];

        $memcached = $this->app['memcached.connector']->connect($servers);

        return $this->repository(new MemcachedStore($memcached, $this->getPrefix()));
    }
1208323
public static function build()
    {
        switch (true) {
            // @codeCoverageIgnoreStart
            case extension_loaded('apc'):
                $cacheDriver = new ApcuCache;
                break;

            case extension_loaded('xcache'):
                $cacheDriver = new XcacheCache;
                break;

            case extension_loaded('memcache'):
                $memcache = new \Memcache;
                $memcache->connect('127.0.0.1');

                $cacheDriver = new MemcacheCache;
                $cacheDriver->setMemcache($memcache);
                break;

            case extension_loaded('redis'):
                $redis = new \Redis();
                $redis->connect('127.0.0.1');

                $cacheDriver = new RedisCache;
                $cacheDriver->setRedis($redis);
                break;
            // @codeCoverageIgnoreEnd

            default:
                $cacheDriver = new ArrayCache;
        }

        return $cacheDriver;
    }
722655
protected function createDefaultRequest()
    {
        $request = Request::createFromGlobals();
        $session = new Session();

        $request->setSession($session);

        return $request;
    }
612985
final public function create()
    {

        $self = $this;

        $splash = $self->getSplash();
        $sessId = $this->generateId($splash);

        session_id($sessId); //Must be called before the sesion start to generate the Id
        session_cache_limiter('none');

        session_name(md5($self->cookie . $splash['agent'] . $splash['ip'] . $splash['domain']));
        session_start();

        //Create the default namespace; affix to splash;
        //The default namespace will contain vars such as -request count, - last session start time, -last session response time, etc
        //The dfault namespace will also contain, instantiated objects?
        //
        $defaultReg = new Registry("default");
        $self->registry['default'] = $defaultReg;

        //update the cookie with the expiry time
        //Create the authenticated namespace and lock it!
        $self->set("handler", $this->authenticator, "auth");

        $this->write($sessId, $splash);
    }
921659
public function save_session(): self
  {
    $id_session = $this->get_id_session();
    //die(var_dump($id_session, $this->check()));
    if ( $id_session && $this->check() ){
      $p =& $this->class_cfg['arch']['sessions'];
      $this->db->update($this->class_cfg['tables']['sessions'], [
        $p['id_user'] => $this->id,
        $p['sess_id'] => $this->session->get_id(),
        $p['ip_address'] => $this->ip_address,
        $p['user_agent'] => $this->user_agent,
        $p['opened'] => 1,
        $p['last_activity'] => date('Y-m-d H:i:s'),
        $p['cfg'] => json_encode($this->sess_cfg)
      ], [
        $p['id'] => $id_session
      ]);
    }
    else{
      $this->set_error(13);
    }
    return $this;
  }
243769
private function create()
    {
        // Generate session ID
        $this->sessionId = $this->generateId();

        // Insert new session into database
        $stmt = $this->db->prepare("INSERT INTO {$this->tableName} (session_id, user_agent, ip_address, time_updated) VALUES (?, ?, ?, ?)");
        $stmt->execute([$this->sessionId, $this->userAgent, $this->ipAddress, $this->now]);
    }
497295
public function connect()
    {
        $this->_service = new SplMemcached();
        $this->_service->addServer($this->_host, $this->_port);
        $stats = $this->_service->getStats();
        if (isset($stats[$this->_host.":".$this->_port])) {
            $this->_connected = true;
        } else {
            throw new ServiceException(
                "Unable to connect to Memcached service"
            );
        }

        return $this;
    }
328934
public static function Session() {
      if (is_null(self::$_Session))
         self::$_Session = self::Factory(self::AliasSession);
      return self::$_Session;
   }
969794
protected function createRedisDriver()
    {
        $serverArray    = $this->config['servers'];
        $persistent     = boolval($this->config['persistent']);
        $prefix         = trim($this->config['prefix']);
        $expireTime     = intval($this->config['lifetime']);

        if ($persistent) {
            foreach ($serverArray as $k => $v) {
                $v['persistent']    = true;
                $serverArray[$k]    = $v;
            }
        }

        $redisServer    = new RedisServer($serverArray);
        $redisStore     = new RedisStore($redisServer, $prefix);
        return new CacheSessionHandler($redisStore, $expireTime);
    }
109271
public function createSession()
    {
        $config = $this->app['config']['concrete.session'];
        $storage = $this->getSessionStorage($config);

        // We have to use "build" here because we have bound this classname to this factory method
        $session = $this->app->build(SymfonySession::class, [$storage]);
        $session->setName(array_get($config, 'name'));

        /* @TODO Remove this call. We should be able to set this against the request somewhere much higher than this */
        /*       At the very least we should have an observer that can track the session status and set this */
        $this->app->make(\Concrete\Core\Http\Request::class)->setSession($session);

        return $session;
    }
950814
private function initializeMemCache()
    {
        $this->memcache = new \Memcache();

        // support multiple hosts using semicolon to separate hosts
        $hosts = explode(';', $this->host);

        // different ports for each hosts the same way
        $ports = explode(';', $this->port);

        if (count($ports) < 1) {
            $ports = array_fill(0, count($hosts), self::DEFAULT_PORT);
        } elseif (count($ports) === 1) {
            // if we have just one port, use it for all hosts
            $usedPort = $ports[0];
            $ports    = array_fill(0, count($hosts), $usedPort);
        }

        foreach ($hosts as $i => $host) {
            if (!isset($ports[$i])) {
                /*
                 * if we have a difference between the count of hosts and
                 * the count of ports, use the default port to fill the gap
                 */
                $ports[$i] = self::DEFAULT_PORT;
            }

            $this->memcache->addServer($host, $ports[$i]);
        }
    }
132017
public function create()
    {
        // Event
        $this->triggerEvent('onBefore' . ucfirst(__FUNCTION__), []);

        $this->triggerEvent('onBeforeStore');

        // Do Action
        $this->getDataMapper()->createOne($this);

        // Event
        $this->triggerEvent('onAfterStore');

        $this->triggerEvent('onAfter' . ucfirst(__FUNCTION__));

        return $this;
    }
1324415
public function destroy()
	{
		// do we have something to destroy?
		if ( ! empty($this->keys))
		{
			// delete the key from the memcached server
			if ($this->memcached->delete($this->config['cookie_name'].'_'.$this->keys['session_id']) === false)
			{
				throw new \FuelException('Memcached returned error code "'.$this->memcached->getResultCode().'" on delete. Check your configuration.');
			}
		}

		parent::destroy();

		return $this;
	}
428715
public function create()
    {
        $instance = self::createReturnOperation($this);
        $this->setId($instance->getId());
        return $instance;
    }
881908
public function create()
    {
        $instance = self::createStripeGateway($this);
        $this->setId($instance->getId());
        return $instance;
    }