public static function setCookieHeaders($cookies)
    {
        if (!empty($cookies) && is_array($cookies) && false === headers_sent() && !self::isTest()) {
            foreach ($cookies as $cookie) {
                setcookie($cookie["name"],
                    $cookie["value"],
                    (array_key_exists('expire', $cookie)) ? $cookie["expire"] : NULL,
                    (array_key_exists('path', $cookie)) ? $cookie["path"] : "/",
                    (array_key_exists('domain', $cookie)) ? $cookie["domain"] : Request::getInstance()->getRootUrl(FALSE),
                    (array_key_exists('secure', $cookie)) ? $cookie["secure"] : FALSE,
                    (array_key_exists('http', $cookie)) ? $cookie["http"] : true
                );
            }
        }
    }
public static function setCookieHeaders($cookies)
    {
        if (!empty($cookies) && is_array($cookies) && false === headers_sent() && !self::isTest()) {
            foreach ($cookies as $cookie) {
                setcookie($cookie["name"],
                    $cookie["value"],
                    (array_key_exists('expire', $cookie)) ? $cookie["expire"] : NULL,
                    (array_key_exists('path', $cookie)) ? $cookie["path"] : "/",
                    (array_key_exists('domain', $cookie)) ? $cookie["domain"] : Request::getInstance()->getRootUrl(FALSE),
                    (array_key_exists('secure', $cookie)) ? $cookie["secure"] : FALSE,
                    (array_key_exists('http', $cookie)) ? $cookie["http"] : true
                );
            }
        }
    }
public static function setCookieHeaders ( $ cookies ) { if ( ! empty ( $ cookies ) && is_array ( $ cookies ) && false === headers_sent ( ) && ! self :: isTest ( ) ) { foreach ( $ cookies as $ cookie ) { setcookie ( $ cookie [ "name" ] , $ cookie [ "value" ] , ( array_key_exists ( 'expire' , $ cookie ) ) ? $ cookie [ "expire" ] : NULL , ( array_key_exists ( 'path' , $ cookie ) ) ? $ cookie [ "path" ] : "/" , ( array_key_exists ( 'domain' , $ cookie ) ) ? $ cookie [ "domain" ] : Request :: getInstance ( ) -> getRootUrl ( FALSE ) , ( array_key_exists ( 'secure' , $ cookie ) ) ? $ cookie [ "secure" ] : FALSE , ( array_key_exists ( 'http' , $ cookie ) ) ? $ cookie [ "http" ] : true ) ; } } }
Method that sets the cookie headers
@param $cookies
Method that sets the cookie headers