public static function getCookieValue($value)
    {
        if (substr($value, 0, 1) !== '"' &&
            substr($value, -1, 1) !== '"' &&
            strpbrk($value, ';,')
        ) {
            $value = '"' . $value . '"';
        }

        return $value;
    }
public static function getCookieValue($value)
    {
        if (substr($value, 0, 1) !== '"' &&
            substr($value, -1, 1) !== '"' &&
            strpbrk($value, ';,')
        ) {
            $value = '"' . $value . '"';
        }

        return $value;
    }
public static function getCookieValue ( $ value ) { if ( substr ( $ value , 0 , 1 ) !== '"' && substr ( $ value , - 1 , 1 ) !== '"' && strpbrk ( $ value , ';,' ) ) { $ value = '"' . $ value . '"' ; } return $ value ; }
Quote the cookie value if it is not already quoted and it contains
problematic characters.

@param string $value Value that may or may not need to be quoted

@return string
Quote the cookie value if it is not already quoted and it contains problematic characters .