src/Http/Cookie/Jar.php
public static function parse($line)
    {
        $parts = explode("\t", trim($line));

        if (count($parts) !== 7) {
            throw new RuntimeException("Invalid cookie JAR format.");
        }

        $config = [];
        $config['httponly'] = '#HttpOnly_' === substr($parts[0], 0, 10);
        $config['domain'] = $config['httponly'] ? substr($parts[0], 10) : $parts[0];
        $config['path'] = $parts[2];
        $config['secure'] = ($parts[3] === 'TRUE') ? true : false;
        $config['expires'] = (integer) $parts[4];
        $config['name'] = $parts[5];
        $config['value'] = $parts[6];

        return $config;
    }
public static function parse($line)
    {
        $parts = explode("\t", trim($line));

        if (count($parts) !== 7) {
            throw new RuntimeException("Invalid cookie JAR format.");
        }

        $config = [];
        $config['httponly'] = '#HttpOnly_' === substr($parts[0], 0, 10);
        $config['domain'] = $config['httponly'] ? substr($parts[0], 10) : $parts[0];
        $config['path'] = $parts[2];
        $config['secure'] = ($parts[3] === 'TRUE') ? true : false;
        $config['expires'] = (integer) $parts[4];
        $config['name'] = $parts[5];
        $config['value'] = $parts[6];

        return $config;
    }
public static function parse ( $ line ) { $ parts = explode ( "\t" , trim ( $ line ) ) ; if ( count ( $ parts ) !== 7 ) { throw new RuntimeException ( "Invalid cookie JAR format." ) ; } $ config = [ ] ; $ config [ 'httponly' ] = '#HttpOnly_' === substr ( $ parts [ 0 ] , 0 , 10 ) ; $ config [ 'domain' ] = $ config [ 'httponly' ] ? substr ( $ parts [ 0 ] , 10 ) : $ parts [ 0 ] ; $ config [ 'path' ] = $ parts [ 2 ] ; $ config [ 'secure' ] = ( $ parts [ 3 ] === 'TRUE' ) ? true : false ; $ config [ 'expires' ] = ( integer ) $ parts [ 4 ] ; $ config [ 'name' ] = $ parts [ 5 ] ; $ config [ 'value' ] = $ parts [ 6 ] ; return $ config ; }
Parses a cookie JAR line.

@param  string    $line The cookie JAR line.
@return array           The data array.
@throws Exception       It throws an exception the cookie JAR line is invalid.
Parses a cookie JAR line .