Get / Set Cookies from qml

I am writing a client program. When I log in, the server will send me several cookies in the "Set-Cookie" header field. I need to get cookies because they will need the rest of the request.

I am trying to get cookies with xmlhttprequest.getResponseHeader ("Set-Cookie") but failed. I do not want to use C ++, so is that possible?

+4
source share
1 answer

No, this is not possible without using C ++.

Look at the source code for the QDeclarativeXMLHttpRequest::fillHeadersList() method. It especially removes the set-cookie and set-cookie2 headers, following the w3c specification for the XMLHttpRequest object. In particular, the behavior of the getAllResponseHeaders method. I.e:

Return all HTTP headers, excluding case-insensitive headers for Set-Cookie or Set-Cookie2, ...

+7
source

All Articles