Cookie inspection

Poul-Henning Kamp phk at phk.freebsd.dk
Tue May 29 10:16:59 CEST 2007


In message <f0cc3e3e0705282205h3b43065atbc1ee434a6adec94 at mail.gmail.com>, "Omar
 Kilani" writes:

>Including the entire req.http.Cookie in the hash key is suboptimal as
>there are a bunch of other cookies set (session cookies, etc)
>depending on other variables.
>
>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... :) and *looks* right,
>but obviously has a very different meaning in VCL where it compiles
>to:

The Planned syntax is:
	req.http.Cookie[language]

and just as for http headers, the headers will be read sequentially
and the last found value is used.

>http://treehou.se/~omar/cookie-inspection-1.patch

Not bad :-)

>The other thing I'd like to be able to do is have some sort of 'first
>match over an array of header values' VCL construct, so you could vary
>the hash by whatever languages in Accept-Language your site supports

Does your backend include a proper Vary: header when it selects on
language ?

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-misc mailing list