setcookie.get_value_by_name

STRINGsetcookie.get_value_by_nameIDwhereSTRINGcookie_name

Available in all subroutines.

Returns a value associated with the cookie_name in the Set-Cookie header contained in the HTTP response indicated by where. An unset value is returned if a cookie is not found or on error. In the vcl_fetch method, the beresp response is available. In vcl_deliver and vcl_log, the resp response is available.

If multiple cookies of the same name are present in the response, the value of the last one will be returned.

When this function does not have enough memory to succeed, the request is failed.

This function conforms to RFC 6265.

Example

set resp.http.MyValue = setcookie.get_value_by_name(resp, "myvalue");

User contributed notes

We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.