[Interest] Using cookies with Image.source
Alexey Godko
koloboid at gmail.com
Wed Aug 12 06:23:50 CEST 2015
Jason, may be you expected this bug
https://bugreports.qt.io/browse/QTBUG-46870
which is Qt 5.5.0 only
I'm downgraded to 5.4.2 coz this issue.
2015-08-12 7:19 GMT+03:00 Alexey Godko <koloboid at gmail.com>:
> Jason, may be you expected this bug
> https://bugreports.qt.io/browse/QTBUG-46870
> which is Qt 5.5.0 only
> I'm downgraded to 5.4.2 coz this issue.
>
> 2015-08-11 23:10 GMT+03:00 Jason H <jhihn at gmx.com>:
>
>> So it looks like there is not a problem at the network level. But for
>> whatever reason, Qt does not like the image (attached).
>>
>> Is there anyone here who can take a look and let me know if it's a
>> libjpeg issue, or qt or something else entirely? Chrome loads the image
>> just fine, as well as a whole host of other programs (Photoshop, OSX
>> Preview, etc).
>>
>> Thanks!
>>
>>
>> *Sent:* Tuesday, August 11, 2015 at 1:41 PM
>> *From:* "Jason H" <jhihn at gmx.com>
>> *To:* "Jason H" <jhihn at gmx.com>
>> *Cc:* "Neil Williams" <neil at copycopy.cc>, "interest at qt-project.org" <
>> interest at qt-project.org>
>>
>> *Subject:* Re: [Interest] Using cookies with Image.source
>> So now I've got a network access factory going woth a singleton cookie
>> jar. It works, kind-of. I am able to access a first image, but subsequent
>> requests for images fail with a message: "error decoding {url}: unable to
>> read image data"
>>
>> The server logs a 200 response for both images, and the content-length is
>> apropriate. Requesting the same image in chrome results in a valid JPEG.
>>
>> We are calling jar->setParent(NULL) after nam->setCookieJar(jar), as per
>> the documentation.
>>
>>
>> *Sent:* Tuesday, August 11, 2015 at 12:16 PM
>> *From:* "Jason H" <jhihn at gmx.com>
>> *To:* "Neil Williams" <neil at copycopy.cc>
>> *Cc:* "interest at qt-project.org" <interest at qt-project.org>
>> *Subject:* Re: [Interest] Using cookies with Image.source
>> Ok. Glad to hear we agree...
>>
>> But how is this not a "bug" I'd figure the XHR and any element with a
>> source property should already be using the same factory (that supports
>> cookies)?
>>
>> *Sent:* Tuesday, August 11, 2015 at 11:57 AM
>> *From:* "Neil Williams" <neil at copycopy.cc>
>> *To:* "Jason H" <jhihn at gmx.com>
>> *Cc:* "interest at qt-project.org" <interest at qt-project.org>
>> *Subject:* Re: [Interest] Using cookies with Image.source
>> You can use QQmlEngine::setNetworkAccessManagerFactory to make the Image
>> element use your own QNetworkAccessManager instances, which in turn you can
>> set a cookie store on that contains your session cookie.
>>
>> http://doc.qt.io/qt-5/qqmlengine.html#setNetworkAccessManagerFactory
>>
>> Note that setNetworkAccessManagerFactory
>> set QQmlNetworkAccessManagerFactory is not used by the QML Webview
>> component.
>>
>> On Tue, Aug 11, 2015 at 4:20 PM, Jason H <jhihn at gmx.com> wrote:
>>>
>>> I have an application that needs a user to login and maintain a cookie.
>>> The AJAX features work just fine. But when I set the Image.source property
>>> to a URL that is protected and requires a session cookie, it gets a 401.
>>>
>>> How can I tell Image elements to use a cookie, the same cookie the AJAX
>>> login result got?
>>> _______________________________________________
>>> Interest mailing list
>>> Interest at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>> _______________________________________________ Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150812/d66d06d7/attachment.html>
More information about the Interest
mailing list