Reset this session to a clean and new state.

@param  bool $regenerateId - whether to generate a new session id and to delete an old session file
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;
    }
203113
public function setRegenerateCycles($cycles = self::DEFAULT_REGENERATE_CYCLES)
    {
        // do we need to do anything? cause a "0" means deactivated!
        $this->regenerateCycles = $cycles;

        // set only if cycle count is given
        if ($cycles > 0) {
            // execute right after session start
            $this->callStack['start']['regenerate'] = [
                $this,
                'handleRegenerate',
            ];
        } else {
            // remove from callstack if exists
            if (isset($this->callStack['start']['regenerate'])) {
                unset($this->callStack['start']['regenerate']);
            }
        }
    }
555476
public function refreshLastUsed($sessionId, $lastUsed = null)
    {
        if ($sessionInformation = $this->getSessionInformation($sessionId)) {
            if ($sessionInformation->getLastUsed() !== $lastUsed) {
                $sessionInformation->refreshLastUsed($lastUsed);
                $this->saveSessionInformation($sessionInformation);
            }
        }
    }
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);
	}
520777
function reset() {
		globalConfig = {};
		modules = {};
		services = {};
		behaviors = {};
		instances = {};
		initialized = false;

		for (var i = 0; i < exports.length; i++) {
			delete application[exports[i]];
			delete Box.Context.prototype[exports[i]];
		}
		exports = [];
	}
1132654
protected function shutdown( $reInitialize = true )
    {
        eZExecution::cleanup();
        eZExecution::setCleanExit();
        eZExpiryHandler::shutdown();
        if ( $reInitialize )
            $this->isInitialized = false;
    }
750682
public function reset()
	{
		$this->meta = false;
		$this->file = false;
		$this->content = false;
		$this->changed = false;
		$this->ttl = 0;
		$this->cacheHash = null;
	}
1204918
public static function regenerateId(bool $deleteOldSessionId = true)
    {
        Base::checkOpen();
        if (Base::driver() == 'file') {
            session_regenerate_id($deleteOldSessionId);
            return true;
        }
        if ($deleteOldSessionId) {
            self::removeAll();
        }
        $random = new \Phalcon\Security\Random();
        session_write_close();
        session_id(str_replace('-', '', $random->uuid()));
        session_start();
        return true;
    }
906106
public function regenerateID($deleteOldSession=false)
	{
		$oldID=session_id();

		// if no session is started, there is nothing to regenerate
		if(empty($oldID))
			return;

		parent::regenerateID(false);
		$newID=session_id();
		$db=$this->getDbConnection();

		$row=$db->createCommand()
			->select()
			->from($this->sessionTableName)
			->where('id=:id',array(':id'=>$oldID))
			->queryRow();
		if($row!==false)
		{
			if($deleteOldSession)
				$db->createCommand()->update($this->sessionTableName,array(
					'id'=>$newID
				),'id=:oldID',array(':oldID'=>$oldID));
			else
			{
				$row['id']=$newID;
				$db->createCommand()->insert($this->sessionTableName, $row);
			}
		}
		else
		{
			// shouldn't reach here normally
			$db->createCommand()->insert($this->sessionTableName, array(
				'id'=>$newID,
				'expire'=>time()+$this->getTimeout(),
				'data'=>'',
			));
		}
	}
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();
    }
651135
public function regenerateId(bool $keepOld = false): string
	{
		// Delete old data if we don't want to keep it

		if(!$keepOld)
		{
			$this->store->delete($this->sessionId);
		}

		// Generate a new id and set a new cookie

		$this->sessionId = $this->generateId();

		$this->setCookie();

		// Return the new session id

		return $this->sessionId;
	}
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;
    }
1102305
private function regenerateId()
    {
        // Acquire a new session ID
        $oldSessionId = $this->sessionId;
        $this->sessionId = $this->generateId();

        // Update session ID in the database
        $stmt = $this->db->prepare("UPDATE {$this->tableName} SET time_updated = ?, session_id = ? WHERE session_id = ?");
        $stmt->execute([$this->now, $this->sessionId, $oldSessionId]);
    }
1238937
public function reset(?string $database, $id = null, bool $pretend = false): void
    {
        if (! \is_null($id)) {
            $this->executeFor($id, function ($entity) use ($database, $pretend) {
                $this->runReset($entity, $database, $pretend);
            });

            return;
        }

        $this->executeForEach(function ($entity) use ($database, $pretend) {
            $this->runReset($entity, $database, $pretend);
        });
    }
9664
protected function reset()
	{
		// create the data container
		$this->data = new DataContainer();

		// create the flash container
		$this->flash = new FlashContainer();

		// initialise the flash expiry store
		$this->flash->set(FlashContainer::EXPIRE_DATA_KEY, array());

	}
407117
public function regenerate(): SessionId
    {
        $this->id = $this->create();
        $this->response->addCookie(
                Cookie::create($this->sessionName, $this->id)->forPath('/')
        );
        return $this;
    }
1230874
private function regenerateTaskById($id)
    {
        try {
            $response = $this->taskQueueService->regenerateTask($id);
            if ($response) {
                $this->output->writeln("<info>Regeneration succes</info>");
            } else {
                $this->output->writeln("<error>Regeneration succes</error>");
            }
        } catch (TaskQueueServiceException $e) {
            $this->output->writeln("<error>Error!:</error>" . $e->getMessage());
        }
    }