---
title: std.collect
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/miscellaneous/std-collect
---

```
VOID std.collect(ID header, STRING separator_character?)
```

**Available in:** all subroutines

Combines multiple instances of the same header into one. The headers are joined 
using the optional separator character parameter. If omitted, `,` is used. A 
space is automatically added after each separator.

Multiple `Set-Cookie` headers should not be combined into a single header as 
this might lead to unexpected results on the browser side.

> **IMPORTANT:** `std.collect` is a destructive operation and will replace any instance of the header in the specified collection.

## Examples

```vcl
# For a request with these Cookie headers:
# Cookie: name1=value1
# Cookie: name2=value2
std.collect(req.http.Cookie, ";");
# req.http.Cookie is now "name1=value1; name2=value2"
```
