AppserverIo\Appserver\ServletEngine\Http\SessionWrapper::renewId PHP Метод

renewId() публичный Метод

Generates and propagates a new session ID and transfers all existing data to the new session.
public renewId ( ) : string
Результат string The new session ID
    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();
    }