How about using setHeader() instead of setRawHeader()? I could guess your cookie header gets cleared by the internals of WebKit that checks the cookie jar on its own.