If the path for $tmpCookies in the curl resolver is not writeable, curl doesn't raise an error. Instead it doesn't call the write callback and spits the response into the output buffer. This is not an obvious error, so I think it would be good to check if the path is writeable and raise an informational exception.