--- a/src/libsync/creds/tokencredentials.cpp
+++ b/src/libsync/creds/tokencredentials.cpp
@@ -62,8 +62,8 @@ protected:
         // A pre-authenticated cookie
         QByteArray token = _cred->_token.toUtf8();
         if (token.length() > 0) {
-            setRawCookie(token, request.url());
-        }
+            req.setHeader(QNetworkRequest::CookieHeader, QVariant::fromValue(QList<QNetworkCookie>() << QNetworkCookie::parseCookies(token)));
+	}
 
         return AccessManager::createRequest(op, req, outgoingData);
     }
