Fwd: question on the cookies and varnish

James Light j.gareth.light at gmail.com
Wed Mar 28 20:47:32 CEST 2012

On Wed, Mar 28, 2012 at 2:32 PM, Paul A. Procacci
<pprocacci at datapipe.com> wrote:
> https://github.com/varnish/libvmod-header
> Haven't tested it, but it seems this would do what the parent wants.
> `header.get(<header>, <regular expression>)`
> import header;
> set req.http.cookie = header.get(req.http.cookie, "PHPSESSID");
> ~Paul

No, that also won't work unless the only cookie is PHPSESSID as this
library will still return the ENTIRE header.
>From the documentation, it looks like this library was written to help
the situation where multiple "Set-Cookie" headers are sent from the
backend and there exists a need to parse several of them, however I
believe the vmod_std module now includes a collect() subroutine, which
is capable of similar functionality by collapsing all headers of the
same type into one long header of that same type:



More information about the varnish-misc mailing list