Session issues when using Varnish

Chris Bloom chrisbloom7 at gmail.com
Wed Mar 16 16:55:56 CET 2011


Thank you, Bjorn, for your response.

Our hosting provider tells me that the following routines have been added to
the default config.

sub vcl_recv {
  # Cache things with these extensions
  if (req.url ~
"\.(js|css|JPG|jpg|jpeg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|swf)$") {
    unset req.http.cookie;
    return (lookup);
  }
}
sub vcl_fetch {
  # Cache things with these extensions
  if (req.url ~
"\.(js|css|JPG|jpg|jpeg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|swf)$") {
    unset req.http.set-cookie;
    set obj.ttl = 1h;
  }
}

Clearly the req.url variable contains the entire request URL, including the
querystring. Is there another variable that I should be using instead that
would only include the script name? If this is the default behavior, I'm
inclined to cry "bug".

You can test that other script for yourself by substituting
maxisavergroup.com for the domain in the example URLs I provided.

PS: We are using Varnish 2.0.6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110316/cb199e8c/attachment-0003.html>


More information about the varnish-misc mailing list