AppserverIo\Appserver\ServletEngine\Http\SessionWrapper::start PHP Method

start() public method

Creates and returns the session cookie to be added to the response.
public start ( ) : void
return void
    public function start()
    {
        // we need the session to be started
        if ($this->isStarted()) {
            return;
        }
        // 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());
        // start the session and set the started flag
        $this->getSession()->start();
        // add the cookie to the response
        $this->getRequest()->setRequestedSessionId($this->getId());
        $this->getResponse()->addCookie($cookie);
    }