public function renewId()
{
// create a new session ID
$this->setId(SessionUtils::generateRandomString());
// load the session manager
$sessionManager = $this->getContext()->search('SessionManagerInterface');
// attach this session with the new ID
$sessionManager->attach($this->getSession());
// create a new cookie with the session values
$cookie = new HttpCookie($this->getName(), $this->getId(), $this->getLifetime(), $this->getMaximumAge(), $this->getDomain(), $this->getPath(), $this->isSecure(), $this->isHttpOnly());
// add the cookie to the response
$this->getRequest()->setRequestedSessionId($this->getId());
$this->getResponse()->addCookie($cookie);
// return the new session ID
return $this->getId();
}