AMPscript
Redirect
RemoveCookie
RemoveResponseHeader
SetCookie
SetResponseHeader
Write
Validate Your Server-Side JavaScript using WSProxy
Sets the name and value of the specified session cookie
When working with cookies, ensure the user experience complies with the protections of a user’s jurisdiction.
Compliance with privacy protections for cookies can include multiple strategies:
This list is a start, but isn’t exhaustive. Place cookie consent high in your list of functionalities to implement.
Note
SetCookie(1, 2, 3, 4)
| Ordinal | Type | Description | |
|---|---|---|---|
| 1 | string | Required | Session cookie name |
| 2 | string | Required | Session cookie value |
| 3 | datetime | Date and time value indicating cookie expiration | |
| 4 | Boolean | Indicates whether cookie works with only HTTPS connections |
1<script runat=server>
2 Platform.Response.SetCookie("cookieName","cookieValue","2015-12-31T14:00:00.999Z",true);
3</script>