src/Control/CookieJar.php
protected function outputCookie(
        $name,
        $value,
        $expiry = 90,
        $path = null,
        $domain = null,
        $secure = false,
        $httpOnly = true
    ) {
        // if headers aren't sent, we can set the cookie
        if (!headers_sent($file, $line)) {
            return setcookie($name, $value, $expiry, $path, $domain, $secure, $httpOnly);
        }

        if (Cookie::config()->uninherited('report_errors')) {
            throw new LogicException(
                "Cookie '$name' can't be set. The site started outputting content at line $line in $file"
            );
        }
        return false;
    }
protected function outputCookie(
        $name,
        $value,
        $expiry = 90,
        $path = null,
        $domain = null,
        $secure = false,
        $httpOnly = true
    ) {
        // if headers aren't sent, we can set the cookie
        if (!headers_sent($file, $line)) {
            return setcookie($name, $value, $expiry, $path, $domain, $secure, $httpOnly);
        }

        if (Cookie::config()->uninherited('report_errors')) {
            throw new LogicException(
                "Cookie '$name' can't be set. The site started outputting content at line $line in $file"
            );
        }
        return false;
    }
protected function outputCookie ( $ name , $ value , $ expiry = 90 , $ path = null , $ domain = null , $ secure = false , $ httpOnly = true ) { // if headers aren't sent, we can set the cookie if ( ! headers_sent ( $ file , $ line ) ) { return setcookie ( $ name , $ value , $ expiry , $ path , $ domain , $ secure , $ httpOnly ) ; } if ( Cookie :: config ( ) -> uninherited ( 'report_errors' ) ) { throw new LogicException ( "Cookie '$name' can't be set. The site started outputting content at line $line in $file" ) ; } return false ; }
The function that actually sets the cookie using PHP

@see http://uk3.php.net/manual/en/function.setcookie.php

@param string $name The name of the cookie
@param string|array $value The value for the cookie to hold
@param int $expiry The number of days until expiry
@param string $path The path to save the cookie on (falls back to site base)
@param string $domain The domain to make the cookie available on
@param boolean $secure Can the cookie only be sent over SSL?
@param boolean $httpOnly Prevent the cookie being accessible by JS
@return boolean If the cookie was set or not; doesn't mean it's accepted by the browser
The function that actually sets the cookie using PHP