git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] http.c: cookie file tightening

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 10, 2024, 16:33 UTC
Message-ID
<xmqqy169xl3p.fsf@gitster.g>
In-Reply-To
<2d76e43e-db79-4572-8f41-60fbbea10af6@gmail.com>
Piotr Szlazak <piotr.szlazak@gmail.com> writes:
Show 8 quoted lines
> On the other hand there is no problem if http.cookieFile='' and
> http.saveCookies=true is used together. Git operation is
> successful. But if GIT_TRACE_CURL=1 GIT_TRACE_CURL_NO_DATA=1 is
> enabled, I can see following warning it the output:
>> 12:19:56.280263 http.c:820 == Info: WARNING: failed to save cookies in
> It comes from:
> https://github.com/curl/curl/blob/master/lib/cookie.c#L1758
> But cookies were accepted by the client and sent back to the server.
Thanks for your experiments.

I do not know if it is safe to call the above observed sympotom "there is no problem". What does it even mean to set cookieFile to an empty string and ask the cookies to be saved? What does the user who makes such a pair of requests

	[http]
		saveCookies = yes
		cookieFile = ""

expect to happen? The session begins with an empty set of cookies, cookies that come from the other side are maintained in-core during the session, and then at the very end of the session what do they want to happen to their cookies? "The system will try to save them but without finding a sensible place to save, it gives a warning without molesting the main goal of the process (which is to interact with the other side)" sounds like a rather strange wish.

I'd consider "The system notices that there is no sensible place to store, so it warns about the conflicting request and ignores http.saveCookies" a bit more sensible behaviour in such a situation, but obviously I am biased.

Previous: Piotr Szlazak
Message 4 of 4 in “http.c: cookie file tightening”
  1. http.c: cookie file tighteningJunio C Hamano, Jul 9, 2024
  2. Jeff KingJul 9, 2024
  3. Piotr SzlazakJul 10, 2024
  4. Junio C HamanoJul 10, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.