remove/unset set-cookies

Traian Bratucu traian.bratucu at
Fri Dec 10 15:12:43 CET 2010

Hello Vincent,

You make a small confusion. The log (varnishlog -b) is showing you that the backend is sending cookies, not that varnish is sending the cookies to the client.
The cookies are removed from the object before they are sent to the client. This means that those cookies will not reach the varnish client (usually user browser).


Client asks url -> varnish receives request, forwards to backend -> backend responds to varnish with set-cookie -> varnish strips cookie (unset beresp.http.set-cookie) and sends the response back to the client

Hope it is clear now for you.


From: varnish-misc-bounces at [mailto:varnish-misc-bounces at] On Behalf Of Vincent
Sent: Friday, December 10, 2010 3:08 PM
To: varnish-misc at
Subject: remove/unset set-cookies


I am trying to remove all set-cookies from the backend but I still found Set-Cookie in the log (varnishlog -b).

I have the following setup:

sub vcl_fetch {
    unset beresp.http.set-cookie;

and varnishlog -b shows something like this:

   16 RxHeader     b Set-Cookie: name=xyc;<>; path=/; expires=Sun, 09-Jan-2011 14:04:10 GMT

I am wondering how to completely remove the Set-Cookie. Currently my hitrate is only 80%, I think the set-cookie header is the main reason.

also what's the difference between
    unset beresp.http.set-cookie;
    remove beresp.http.set-cookie;

Thank you,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list