- Find
beresp.http.Set-Cookie
and change it like the below
# Only allow cookies to be set if we're in admin area
if (beresp.http.Set-Cookie && bereq.url !~ "/wp-(login|admin)") {
unset beresp.http.Set-Cookie;
}
- The way forward cookie in varnish
# Drop any cookies sent to Wordpress.
sub vcl_recv {
if (!(req.url ~ "wp-(login|admin)")) {
unset req.http.cookie;
}
}
# Drop any cookies Wordpress tries to send back to the client.
sub vcl_fetch {
if (!(req.url ~ "wp-(login|admin)")) {
unset beresp.http.set-cookie;
}
}