Handling multiple beresp.http.set-cookie headers

Michal Paal michal.paal at digmia.com
Fri Mar 16 01:04:37 CET 2012


> Hi,
> 
> I'm trying to solve this problem for about a week. Situation is that I need to check in VCL, if backend response has cookie with "Logged_in:Y". Backend is also often setting more cookies, and there is only little chance that we can make developers change application, because it is too complex. From my observation and debugging, if I configure this in vcl_fetch:
> 
>         if (beresp.http.Set-Cookie ~ "Logged_in:Y") {
>             return (hit_for_pass);
>         }
> 
> The problem is that "beresp.http.Set-Cookie" is filled only with first Set-Cookie header from backend. If there are other Set-Cookie headers, I cannot match anything in them.
> 
> So, my question is can I somehow match or access all Set-Cookie headers?
> 
> I've also tryed consolidating Set-Cookie headers using vmod_std.collect, but this violates RFC and doesn't work for clients.
> 
> I would be very thankful for any ideas.
> 
> Have a nice day!
> 
> 
> 
> Michal Paal
> 
> http://www.digmia.com
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5023 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20120316/69ebaea3/attachment.bin>


More information about the varnish-misc mailing list