I am trying figure out how to allow the backend to see tracking cookies on specific registration pages but ignore them on others. Currently, I'm trying to use a custom header sent from the backend to set beresp.ttl = 0s;
inside the vcl_fetch
:
if (beresp.http.cache-control ~ "max-age=-30") {
set beresp.ttl = 0s;
}
But the reg pages still prevent the backend from reading the cookie.
In the vcl_recv
I am removing them by using this method:
set req.http.Cookie =
regsuball(req.http.Cookie, "(^|;\s*)(__[a-z]+|_ga|_mkto_trk)=[^;]*", "");
set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");
if (req.http.Cookie ~ "^\s*$") {
unset req.http.Cookie;
}
How can I allow the cookie to get read on the backend on these specific pages? I assume I need to create exceptions in the vcl_recv
?