Fix for cookie session curl error as per http://stackoverflow.com/questions/26450327/php-curl-setopt-error-invalid-characters.  Fixes #1042