add
Available inall subroutines.
Appends an HTTP header to a request or response object.
add resp.http.Set-Cookie = "myCookie=foo; path=/; SameSite=Strict; Secure; max-age=60";
If the header already exists, another with the same name is appended to the same request, and the existing header remains in place. The add
statement is commonly used to add Set-Cookie
headers, where it is important not to override any other Set-Cookie
headers that might already be in the response.
If you prefer to replace any existing header value, use set
instead.
User contributed notes
BETADo you see an error in this page? Do have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact support@fastly.com)