Cookie inspection

Dag-Erling Smørgrav des at
Tue May 29 09:53:22 CEST 2007

"Omar Kilani" <omar.kilani at> writes:
> I'd like to modify req.hash in vcl_hash to take into account the value
> of this particular cookie [...]
> From looking through the varnish-cache code, I don't think this type
> of operation is supported, and I'm not sure what the best way to
> represent this in VCL is.

Poul-Henning is working on making multi-value headers accessible as
associative arrays, e.g. "req.http.cache-control[max-age]" for
"Cache-control: max-age".  This implies not only inspection but also
modification of individual fields.  Your patch is a step in the right
direction, though it probably duplicates (or conflicts with) part of
Poul-Henning's work.

In any case, could you please open a ticket with the patch as an

> Doing something like req.http.Cookie.LANGUAGE *could* theoretically do
> the right thing (and use http_GetHdrField, although some browsers can
> send multiple values for the same cookie name... :)

AFAIR from RFC2616, if multiple values are provided for the same key,
only the last one applies.

Dag-Erling Smørgrav
Senior Software Developer
Linpro AS -

More information about the varnish-misc mailing list