remove/unset set-cookies

Traian Bratucu traian.bratucu at eea.europa.eu
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).

So:

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.

Traian

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

Hi,

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; domain=.example.com<http://example.com>; 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;
and
    remove beresp.http.set-cookie;


Thank you,

Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20101210/12ae4115/attachment-0003.html>


More information about the varnish-misc mailing list