Caching for some cookies?

Albert Tollkuçi albert.tollkuci at gmail.com
Fri Sep 2 18:28:54 CEST 2016


Thank you Guillaume,
probably I'm missing something, but can't find any unset.

Is there anything running before vcl_backend_response? I see the cookie in
the backend side and is not there anymore in vcl_backend_response?

Albert

On Fri, Sep 2, 2016 at 10:53 AM, Guillaume Quintard <
guillaume at varnish-software.com> wrote:

> Hi,
>
> Look at the varnishlog, there should be a trace of that unset, once
> confirmed, find it in your vcl.
>
> Know that if you don't return from a subroutine, the built-in vcl is
> executed ("locate builtin.vcl" to find a commented version of it).
>
> On Sep 1, 2016 12:59, "Albert Tollkuçi" <albert.tollkuci at gmail.com> wrote:
>
>> Hello,
>> I've started using Varnish a few months ago and my vcl files has started
>> to get complicated. I'm serving 5 different sites with the same varnish
>> instance (using different backends) and this part is working.
>>
>> Now I have some cases that for some sites I need to keep some cookies and
>> cache different versions based on them. Basic scenario is to show the user
>> a message only the first time he sees the page. Without varnish if the
>> cookie is not there I set it and show the message. Next time the cookie is
>> there and no message is shown.
>>
>> With varnish my logic is to include the cookie in hash and cache two
>> different versions. The challenge is to make sure cookies are set correctly
>> and here I'm kind of stack. I've added some debug messages in my vcl and
>> for some reason I'm not seeing the cookies I set in my server in
>> vcl_backend_response. Inside the routine, I have the following code in the
>> beginning:
>>
>>        # AT: DEBUG
>>        if(bereq.http.x-at-debug == "1") {
>>          std.log("AT DEBUG - bereq URL: " + bereq.url + ". Cookies: '" +
>> bereq.http.Cookie + "'");
>>          std.log("AT DEBUG - beresp set-cookie: '" +
>>  beresp.http.set-cookie + "'");
>>        }
>>
>> I set x-at-debug header in vcl_recv based on my IP, so I can track only
>> my requests. In the server side I see the cookie "__IKUB_AL_Myikub_PopUp"
>> being set, but in vcl_backend_response is not.
>>
>> Is there anything in between that can strip the cookie?
>>
>> Thank you,
>> Albert
>>
>>
>>
>> --
>> Web: http://www.tollkuci.com
>> Follow me on: LinkedIn <http://www.linkedin.com/in/alberttollkuci>
>> Google+ <https://plus.google.com/+AlbertTollku%C3%A7i/posts> Facebook
>> <https://www.facebook.com/albert.tollkuci> Twitter
>> <https://twitter.com/AlbertTollkuci> Career 2.0
>> <http://careers.stackoverflow.com/atollkuci>
>>
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc at varnish-cache.org
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>
>


-- 
Web: http://www.tollkuci.com
Follow me on: LinkedIn <http://www.linkedin.com/in/alberttollkuci> Google+
<https://plus.google.com/+AlbertTollku%C3%A7i/posts> Facebook
<https://www.facebook.com/albert.tollkuci> Twitter
<https://twitter.com/AlbertTollkuci> Career 2.0
<http://careers.stackoverflow.com/atollkuci>
------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160902/45f4eebd/attachment-0001.html>


More information about the varnish-misc mailing list