Cornel.Vaideanu at greppysystems
Aug 30, 2012, 3:54 AM
Post #7 of 7
RE: When setting a cookie, the old ones are lost
[In reply to]
I understand, thank you for the explanations. I have installed the vmod you suggested and it works now.
I have also needed to compile varnish from sources. ( for feature help... )
From: Paul A. Procacci [pprocacci [at] datapipe]
Sent: Thursday, August 30, 2012 12:01 PM
To: Cornel Vaideanu
Cc: Per Buer; varnish-misc [at] varnish-cache
Subject: Re: When setting a cookie, the old ones are lost
The problem is simply with browsers interpreting set-cookie headers
While appending '; foo=bar' _should_ work, it _will not_ work in all
All the major browsers that I've tested have worked with sending
multiple set-cookie headers. That's not to say it's right, but it
is to say it works _for me_.
You need to for obvious reasons test this for yourself to confirm, but
my solution has always been to add additional set-cookie headers
(which you can accompish easily with that vmod).
On Thu, Aug 30, 2012 at 08:13:58AM +0000, Cornel Vaideanu wrote:
> Thank you for the advices, in this scenario I am forced to use a
> cookie because I want to make a 307 redirect every time varnish would
> send 503 to borwser, but I need to send a cookie to prevent redirect
> If you have any solution for this, your advice will be highly
> I tried this way: set resp.http.set-cookie = resp.http.set-cookie +
> but it didn't work for me. Are you sure this method should work or I
> am forced to use the vmod that Paul suggested ?
> Thank you very much
> From: Per Buer [perbu [at] varnish-software]
> Sent: Thursday, August 30, 2012 10:48 AM
> To: Cornel Vaideanu
> Cc: varnish-misc [at] varnish-cache
> Subject: Re: When setting a cookie, the old ones are lost
> On Thu, Aug 30, 2012 at 9:00 AM, Cornel Vaideanu
> <Cornel.Vaideanu [at] greppysystems> wrote:
> Can you tell me how can I set a new cookie without losing the cookies
> that apache sends ?
> The problem is that there can, according to the IETF, only one
> Set-Cookie header. What you want to so is to modify the exsisting
> set-cookie header.
> Something like:
> set resp.http.set-cookie = resp.http.set-cookie + ";foo=bar"
> You could add another Set-Cookie header as Paul proposed but that
> breaks the spec, all though it will probably work for at least 99% of
> the clients out there.
> Per Buer
> Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer
> Varnish makes websites fly!
> Whitepapers | Video | Twitter
> Cornel Vaideanu
> PHP Developer
> 17-19A, Ploiesti Street,
> Cluj-Napoca, Romania
> 1. mailto:Cornel.Vaideanu [at] greppysystems
> 2. http://www.varnish-software.com/whitepapers
> 3. http://www.youtube.com/watch?v=x7t2Sp174eI
> 4. https://twitter.com/varnishsoftware
> 5. http://greppysystems.com/
> varnish-misc mailing list
> varnish-misc [at] varnish-cache
This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See http://www.datapipe.com/legal/email_disclaimer/ for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you.
17-19A, Ploiesti Street,
varnish-misc mailing list
varnish-misc [at] varnish-cache