Regenerates the session id
964244
public function regenerate()
    {
		// generate a new random session id
		$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
		$sessionId = '';
		for ($i=0; $i < 32; $i++)
		{
			$sessionId .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
		}

		// store the new session id
		$this->setSessionId($sessionId);
	}
1227052
function storeSessionID(sid){
    var tssec = Date.now() + swsOptions.sessionMaxAge*1000;
    sessionIDs[sid] = tssec;
    //debug('Session ID updated: %s=%d', sid,tssec);
}
977746
public function regenerateId(bool $deleteOldSession = true): bool
    {
        if ($this->isStarted()) {
            return session_regenerate_id($deleteOldSession);
        }
        // TODO : ajouter un else et lever une exception si on essaye de faire un regenerate ID alors que la session n'est pas démarrée !!!!

        return false;
    }
654642
def _generate_session_id(self):
        """"""

        while True:
            rand = os.urandom(16)
            now = time.time()
            secret_key = self._config.secret_key
            session_id = hashlib.sha1(("%s%s%s%s" % (rand, now, utils.safestr(web.ctx.ip), secret_key)).encode("utf-8"))
            session_id = session_id.hexdigest()
            if session_id not in self.store:
                break
        return session_id
513837
def session_id(self):
        
        return None if not self.session or 'JSESSIONID' not in \
            self.session.cookies else 'JSESSIONID={}'.format(
                self.session.cookies['JSESSIONID'])
1126944
def generate_session_id(data):
    
    host = data['environ']['HOST']
    tty = data['environ'].get('TTY') or 'NO_TTY'
    return ':'.join(map(str, [
        host, tty, os.getppid(), data['start']]))
1159144
function (login_id, session, data) {

	// acknowledge as 'logined'	
	l_loginID[login_id] = data.account;
	
	// init session
	session['_account'] = data.account;
	
	// TODO: needs to fix this, should read "groups" from DB
	session['_groups'] = data.groups;
	session['_permissions'] = data.permissions;
	session['lastStatus'] = data.lastStatus;
	
	// TODO: centralize handling of logined users?
	//SR.User.addGroup(user_data.account, ['user', 'admin']);
}
1212148
public function regenerate($id = null, $trydeleteold = false)
    {
        if (headers_sent()) {
            throw new Exception('Cannot modify header information - headers already sent', 2);
        }

        $old = $this->savepath . '/' . $this->prefix . $this->currentId;

        $this->commit(false);

        if (empty($id)) {
            $tmpname = Storage::temp(null, 'session', $this->prefix, '');

            if ($tmpname === false) {
                throw new Exception('Failed to create new session file', 2);
            }

            $id = substr(basename($tmpname), 5);
        } else {
            $tmpname = $this->savepath . '/' . $this->prefix . $id;
        }

        if (copy($this->handle, $tmpname) === false) {
            throw new Exception('Failed to copy new old session', 2);
        }

        flock($this->handle, LOCK_UN);
        fclose($this->handle);

        if ($trydeleteold) {
            unlink($old);
        }

        $this->handle = fopen($tmpname, 'a+');

        $this->currentId = $id;

        $this->cookie();
    }
50189
def append_session_id_parameter
      return unless request # for test process
      return unless apply_trans_sid?
      return unless jpmobile_session_id

      response.body = response.body.gsub(%r{(</form>)}i, sid_hidden_field_tag + '\1')
    end
1266709
public static function regenerate(bool $destroy = false): void
    {
        if ($destroy) {
            self::clear();
        }

        if (session_status() === PHP_SESSION_ACTIVE) {
            session_regenerate_id($destroy);
        }
    }
865410
def restore_session
      guest_token, payment_method_id =
        params.fetch(:merchantReturnData).split("|")

      cookies.permanent.signed[:guest_token] = guest_token

      @payment_method = Spree::PaymentMethod.find(payment_method_id)

      @order = Spree::Order.find_by!(number: order_number)
    end
767583
public function reset($regenerateId) {
        if (!is_bool($regenerateId)) throw new IllegalTypeException('Illegal type of parameter $regenerateId: '.gettype($regenerateId));

        if ($regenerateId) {
            // assign new id, delete old file
            session_regenerate_id(true);
        }

        // empty the session
        $this->removeAttribute(\array_keys($_SESSION));

        // initialize the session
        $request = $this->request;                                              // TODO: $request->getHeader() einbauen
        $_SESSION['__SESSION_CREATED__'  ] = microtime(true);
        $_SESSION['__SESSION_IP__'       ] = $request->getRemoteAddress();      // TODO: forwarded remote IP einbauen
        $_SESSION['__SESSION_USERAGENT__'] = $request->getHeaderValue('User-Agent');

        $this->new = true;
    }
548072
def regenerate(session):
    """"""
    if platform.system() == 'Windows':
        output_dir = '../generated/windows'
    else:
        output_dir = '../generated/unix'

    session.run(shutil.rmtree, 'build', ignore_errors=True)
    session.run(os.makedirs, 'build')
    session.chdir('build')
    session.run('cmake', '../third_party/cmark')
    session.run(shutil.copy, 'src/cmark-gfm_export.h', output_dir)
    session.run(shutil.copy, 'src/cmark-gfm_version.h', output_dir)
    session.run(shutil.copy, 'src/config.h', output_dir)
    session.run(shutil.copy, 'extensions/cmark-gfm-extensions_export.h', output_dir)
    session.chdir('..')
    session.run(shutil.rmtree, 'build')
889104
public RefreshSessionResponse refreshSession(String sessionId) {
        RefreshSessionRequest request = new RefreshSessionRequest();
        request.setSessionId(sessionId);
        return refreshSession(request);
    }
591047
def use_session(self, session_id):
        
        self.session = Session(lgn=self, id=session_id)
        return self.session
1142414
public function resetSession()
    {
        /*
         * TODO not in love with suppressing errors
         */
        if (session_status() !== PHP_SESSION_ACTIVE) {
            @session_start();
        }
        @session_destroy();
        @session_unset();
        @session_start();
        session_regenerate_id(true);
        $_SESSION[__CLASS__] =& $this;
        session_write_close();
    }
1107456
public function regenerate()
    {
        // If headers already sent can't do much
        if (headers_sent()) {
            return;
        }
        
        // Clear old session data
        $_SESSION = [];
        // Set session start time
        $_SESSION['s3ss10nCr3at3d'] = time();
        // Set new session token
        if ($this->matchUserAgent) {
            $_SESSION['n3k0t'] = hash_hmac($this->hashAlgo, $_SERVER['HTTP_USER_AGENT'] . $_SESSION['s3ss10nCr3at3d'], $this->hashKey);
        } else {
            $_SESSION['n3k0t'] = hash_hmac($this->hashAlgo, $_SESSION['s3ss10nCr3at3d'], $this->hashKey);
        }
        // Regenerate session
        session_regenerate_id();
    }