Faidon Liambotis <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #19 from Faidon Liambotis <> ---
For completeness, copying from my postmortem:

What happens is, manipulation of the Set-Cookie header from VCL was
broken. Ori's code is:

    set_cookie_header = VRT_GetHdr(sp, HDR_RESP, "\013set-cookie:");
    if (set_cookie_header == NULL) {
            // New header
            VRT_SetHdr(sp, HDR_RESP, "\013Set-Cookie:", cookie_out,
    } else {
            // Append to existing header
            VRT_SetHdr(sp, HDR_RESP, "\013Set-Cookie:", set_cookie_header, ";
", cookie_out, vrt_magic_string_end);

While this looks correct on a first glance, it makes you wonder what
would happen with multiple occurences of Set-Cookie. What happens is
exactly what you observe: VRT_GetHdr() returns only one of them and
VRT_SetHdr() sets all of them, essentially discarding all Set-Cookie
headers but one.

As for going forward: the std vmod has an std.collect() function to
collect multiple headers into one, but I don't believe this would work
with Set-Cookie. There's
that's designed exactly to address this use case -- its description is
"Varnish Module (vmod) for manipulation of duplicated headers (for
instance multiple set-cookie headers)". We should probably use this

You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
Wikibugs-l mailing list

Reply via email to