Builds a session object.
775401
def _build_session(self, name, start_info, end_info):
    """"""

    assert start_info is not None
    result = api_pb2.Session(
        name=name,
        start_time_secs=start_info.start_time_secs,
        model_uri=start_info.model_uri,
        metric_values=self._build_session_metric_values(name),
        monitor_url=start_info.monitor_url)
    if end_info is not None:
      result.status = end_info.status
      result.end_time_secs = end_info.end_time_secs
    return result
613688
public function session($session_id)
	{
		$session = new Object;
		$session->session_id = $session_id;
		$session->data       = $this->read($session_id);

		return $session;
	}
660774
def create_session(self):
        
        ret = requests.Session()
        ret.headers['User-Agent'] = self.user_agent
        for k, v in self.options.items():
            setattr(ret, k, v)
        return ret
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;
    }
903288
def do_session(self, args):
        """"""
        filename = 'Not specified' if self.__session.filename is None \
            else self.__session.filename

        print('{0: <30}: {1}'.format('Filename', filename))
28695
def build(self):
        """"""
        from ambry.orm.config import BuildConfigGroupAccessor

        # It is a lightweight object, so no need to cache
        return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)
1284550
function generateSession() {
    const session = {}
    //you can alter the cookie options in nexts
    session.cookie = {}
    for (const prop in cookie) {
      session.cookie[prop] = cookie[prop]
    }
    compatMaxage(session.cookie)
    return session
  }
998164
def build_object(self, obj):
        """"""
        try:
            build_path = self.get_build_path(obj)
            self.request = self.create_request(build_path)
            self.request.user = AnonymousUser()
            self.set_kwargs(obj)
            self.build_file(build_path, self.get_content())
        except Http404:
            # cleanup directory
            self.unbuild_object(obj)
188887
def _build_session(self, auth_class, *args, **kwargs):
        
        session = requests.session()
        session.auth = auth_class(*args, **kwargs)
        session.headers.update({'CB-VERSION': self.API_VERSION,
                                'Accept': 'application/json',
                                'Content-Type': 'application/json',
                                'User-Agent': 'coinbase/python/2.0'})
        return session
1245328
def save_session_to_file(self, sessionfile):
        """"""
        pickle.dump(requests.utils.dict_from_cookiejar(self._session.cookies), sessionfile)
386098
function createSession (callback) {
      var path, sessionCreate;

      _log(me.setting);
      path = me.setting.apiroot + '/session/create.json?apiKey=' + me.setting.apikey;
      _log(path);

      sessionCreate = http.request({
        port: me.setting.port,
        host: me.setting.host,
        method: 'POST',
        path: path
      });

      sessionCreate.on('response', function (response) {
        var data = '';

        _log('STATUS: ' + response.statusCode);
        _log('HEADERS: ' + JSON.stringify(response.headers));

        if (200 !== response.statusCode) {
          callback(response.statusCode);
          return;
        }

        response.on('data', function (chunk) {
          data += chunk;
        });

        response.on('end', function() {
          var sessionInfo = JSON.parse(data);
          _log('SID OK: ' + sessionInfo.sid);

          callback(response.statusCode, sessionInfo);
        });
      });

      sessionCreate.on('error', function(err) {
        console.error(err);
      });

      sessionCreate.end();
    }
611783
def _create_session(self):
        
        self.driver = webdriver.Chrome(chrome_options=self.opts, **self.driver_args)
        self.driver.set_window_size(1920, 1080)
200056
def put(self, *args, **kwargs):
        
        return self.session.put(*args, **self.get_kwargs(**kwargs))
508267
def set_session(self, cookies):
        
        self.__session.cookies = requests.utils.cookiejar_from_dict(cookies)
447088
private function initSession()
    {
        $transport = $this->transportRegistry->getTransport($this->profile->get('transport', 'name'));
        $repository = $transport->getRepository($this->profile->get('transport'));

        $credentials = new SimpleCredentials(
            $this->profile->get('phpcr', 'username'),
            $this->profile->get('phpcr', 'password')
        );

        $session = $repository->login($credentials, $this->profile->get('phpcr', 'workspace'));

        // if you are wondering wtf here -- we wrap the PhpcrSession
        if (!$this->session) {
            $this->session = new PhpcrSession($session);
        } else {
            $this->session->setPhpcrSession($session);
        }
    }
55190
protected function createSession()
    {
        if (class_exists('Illuminate\Filesystem\Filesystem') && class_exists('Illuminate\Session\FileSessionHandler')) {
            $fileSessionHandler = new FileSessionHandler(new Filesystem(), __DIR__.'/../../../../../storage/sessions', 5);

            $store = new Store('alerts', $fileSessionHandler);

            return new NativeSession($store);
        }
    }
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);
    }