private function validateName($name)
    {
        if (strlen($name) < 1) {
            throw new \InvalidArgumentException('The name cannot be empty');
        }

        // Name attribute is a token as per spec in RFC 2616
        if (preg_match('/[\x00-\x20\x22\x28-\x29\x2C\x2F\x3A-\x40\x5B-\x5D\x7B\x7D\x7F]/', $name)) {
            throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name));
        }
    }
private function validateName($name)
    {
        if (strlen($name) < 1) {
            throw new \InvalidArgumentException('The name cannot be empty');
        }

        // Name attribute is a token as per spec in RFC 2616
        if (preg_match('/[\x00-\x20\x22\x28-\x29\x2C\x2F\x3A-\x40\x5B-\x5D\x7B\x7D\x7F]/', $name)) {
            throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name));
        }
    }
private function validateName ( $ name ) { if ( strlen ( $ name ) < 1 ) { throw new \ InvalidArgumentException ( 'The name cannot be empty' ) ; } // Name attribute is a token as per spec in RFC 2616 if ( preg_match ( '/[\x00-\x20\x22\x28-\x29\x2C\x2F\x3A-\x40\x5B-\x5D\x7B\x7D\x7F]/' , $ name ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The cookie name "%s" contains invalid characters.' , $ name ) ) ; } }
Validates the name attribute.

@see http://tools.ietf.org/search/rfc2616#section-2.2

@param string $name

@throws \InvalidArgumentException If the name is empty or contains invalid characters.
Validates the name attribute .