<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">Hello,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">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.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">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.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">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:</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)"><div class="gmail_default"> # AT: DEBUG</div><div class="gmail_default"> if(bereq.http.x-at-debug == "1") {</div><div class="gmail_default"> std.log("AT DEBUG - bereq URL: " + bereq.url + ". Cookies: '" + bereq.http.Cookie + "'");</div><div class="gmail_default"> std.log("AT DEBUG - beresp set-cookie: '" + beresp.http.set-cookie + "'");</div><div class="gmail_default"> }</div><div><br></div><div>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.</div><div><br></div><div>Is there anything in between that can strip the cookie?</div><div><br></div><div>Thank you,</div><div>Albert</div><div><br></div></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)"><br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;color:rgb(61,133,198);font-family:"trebuchet ms",sans-serif">Web: </span><a href="http://www.tollkuci.com/" style="font-size:small;font-family:"trebuchet ms",sans-serif" target="_blank">http://www.tollkuci.com</a><br></div><div><span style="color:rgb(61,133,198);font-family:"trebuchet ms",sans-serif;font-size:small">Follow me on: </span><a href="http://www.linkedin.com/in/alberttollkuci" style="font-family:arial,verdana,sans-serif;font-size:12px;margin:0px;padding:0px;color:rgb(31,162,225);text-decoration:none" target="_blank"><img alt="" height="24" src="http://www.tollkuci.com/blog/IMAGES%2f2014%2f02%2flinkedin_icon.png.jpgx" width="24" style="margin: 2px; padding: 0px; vertical-align: middle;">LinkedIn</a> <a href="https://plus.google.com/+AlbertTollku%C3%A7i/posts" style="font-family:arial,verdana,sans-serif;font-size:12px;margin:0px;padding:0px;color:rgb(31,162,225);text-decoration:none" target="_blank"><img alt="" height="24" src="http://www.tollkuci.com/blog/IMAGES%2f2014%2f02%2fgoogleplus-icon.png.jpgx" width="24" style="margin: 2px; padding: 0px; vertical-align: middle;">Google+</a> <a href="https://www.facebook.com/albert.tollkuci" style="font-family:arial,verdana,sans-serif;font-size:12px;margin:0px;padding:0px;color:rgb(31,162,225);text-decoration:none" target="_blank"><img alt="" height="24" src="http://www.tollkuci.com/blog/IMAGES%2f2014%2f02%2fFacebook_Icon.png.jpgx" width="24" style="margin: 2px; padding: 0px; vertical-align: middle;">Facebook</a> <a href="https://twitter.com/AlbertTollkuci" style="font-family:arial,verdana,sans-serif;font-size:12px;margin:0px;padding:0px;color:rgb(31,162,225);text-decoration:none" target="_blank"><img alt="" height="24" src="http://www.tollkuci.com/blog/IMAGES%2f2014%2f02%2fTwitterIcon.png.jpgx" width="24" style="margin: 2px; padding: 0px; vertical-align: middle;">Twitter</a> <a href="http://careers.stackoverflow.com/atollkuci" style="font-family:arial,verdana,sans-serif;font-size:12px;margin:0px;padding:0px;color:rgb(31,162,225);text-decoration:none" target="_blank"><img alt="" height="24" src="http://www.tollkuci.com/blog/IMAGES%2f2014%2f02%2fcareers-icon.png.jpgx" width="24" style="margin: 2px; padding: 0px; vertical-align: middle;">Career 2.0</a></div><font style="font-family:"trebuchet ms",sans-serif;color:rgb(102,102,102)"><br></font></div></div>
</div>