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);
    }
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);
    }
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 ) ; }
Creates and returns the session cookie to be added to the response.

@return void
Creates and returns the session cookie to be added to the response .