Adds a Set-Cookie header to the response using the indicated Name. The cookie's value and optional attributes will automatically be included as indicated by each argument.
Syntax
Response = HTTP_Services('SetCookie', Name, Value, Expires, MaxAge, Domain, Path, Secure, HttpOnly, Extension)
Returns
N/A
Parameters
Parameter | Description |
---|---|
Name | Name of the cookie. Required |
Value | Value for the cookie. If empty, only the Name will be sent. Optional |
Expires | Date the cookie should expire. Should use RFC1123 formatting. For example: "Sun, 06 Nov 1994 08:49:37 GMT" If a number is passed in, the system will assume this is an an internal date or datetime and attempt to convert it to RFC1123 formatting. Optional |
MaxAge | Number of seconds that the cookie should remain alive. Optional |
Domain | Hosts to which the cookie will be sent. For example, "examples.com", "www.examples.com", or "examples.org" Optional |
Path | Scope of the cookie. For example, "/api/reports" or "/api/users". Optional |
Secure | Boolean flag to indicate that the "Secure" attribute should be included. Optional |
HttpOnly | Boolean flag to indicate that the "HttpOnly" attribute should be included. Optional |
Extension | Any other content to include in the cookie. May or may not be name/value paired. Optional |
Remarks
This service is a wrapper around the SetResponseHeaderField service. Each cookie with a unique name will have its own Set-Cookie response header.