SoupCookieJar replaces cookies rather than appending them
@epm
Submitted by Emilio Pozuelo Monfort Assigned to libsoup-maint@gnome.bugs
Link to original bug (#574571)
Description
Hi,
In libsoup/soup-cookie-jar.c, request_started() removes custom cookies. I'd expect it to respect them, and only append cookies without removing the previous one if found.
My use case:
Liferea has support for Google Reader. Authentication for Google Reader works the following way:
- You send a POST with the authentication in the body over HTTPS, and if it success, you get a token in a response body with which you can identify yourself using it in a Cookie header in your following petitions.
So what we do is to store the token and use it in every petition for that Google Reader subscription. I add it to a Cookie header before queueing the message, but then the header is either removed or replaced with a cookie that won't work.
We use this rather than adding the token to the cookie jar so that we can support several subscription to google reader at the same time with different users, sending the appropriate cookie header for each subscription.
This patch makes the CookieJar prepend, rather than replace and remove, the cookies in the Cookie header. I'm not sure if it will have side effects in Epiphany or other applications.
Version: 2.25.x