public function renewId()
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('Tried to renew the session identifier, but the session has not been started yet.', 1351182429);
}
if ($this->remote === true) {
throw new Exception\OperationNotSupportedException(sprintf('Tried to renew the session identifier on a remote session (%s).', $this->sessionIdentifier), 1354034230);
}
$this->removeSessionMetaDataCacheEntry($this->sessionIdentifier);
$this->sessionIdentifier = Algorithms::generateRandomString(32);
$this->writeSessionMetaDataCacheEntry();
$this->sessionCookie->setValue($this->sessionIdentifier);
return $this->sessionIdentifier;
}