名前を変更したい場合は、次のようになると思います。
sub vcl_fetch {
#renamed after receiving the backend
set beresp.http.set-cookie = regsuball(beresp.http.set-cookie, "bad_cookie", "good_cookie");
set beresp.http.cookie = regsuball(beresp.http.cookie, "bad_cookie", "good_cookie"); }
}
sub vcl_deliver {
#renamed before sending the client
set resp.http.set-cookie = regsuball(beresp.http.set-cookie, "bad_cookie", "good_cookie");
set resp.http.cookie = regsuball(beresp.http.cookie, "bad_cookie", "good_cookie"); }
}
すべてのCookieを削除する場合:
sub vcl_fetch {
#deleted after receiving the backend
remove beresp.http.set-cookie;
remove beresp.http.cookie;
}
sub vcl_deliver {
#deleted before sending the client
remove resp.http.set-cookie;
remove resp.http.cookie;
}
beresp.http.set-cookie
最初の Set-Cookie ヘッダーのみを読み取ります。一部を削除して残りを使用したい場合: github.com/varnish/libvmod-header **