WSHelper.WSServerCookiesType
The WSHelper.WSServerCookiesType
defines a dynamic
array for storing cookies.
WSServerCookiesType
TYPE WSServerCookiesType DYNAMIC ARRAY OF RECORD
name STRING, # Cookie name
value STRING, # Cookie value
path STRING, # Cookie path (or null)
domain STRING, # Cookie domain (or null)
expires DATETIME YEAR TO SECOND, # Cookie expiration date (or null)
httpOnly BOOLEAN,
secure BOOLEAN
sameSite STRING # Lax (default), Strict, or None (requires secure)
END RECORD
name
is the name of the cookie to be set. This field is mandatory. It will be URL-encoded on the wire.value
is the value of the cookie to be set. This field is mandatory. It will be URL-encoded on the wire.path
is the main path the cookie has to be set for. Any path containing that main path will then return the cookie. If no name is set, the cookie will be set by the path the client has provided.domain
is the domain (hostname) or sub-domain (for example: .strasbourg.4js.com) the cookie will be set on client side. If not set, the domain will be the hostname provided by the client.expires
is aDATETIME YEAR TO SECOND
(on local time) from when that cookie will expire, and thus not be sent by the client anymore. IfNULL
, the cookie is called session cookie and will be sent as long as the client keeps the session open.http_only
is set toTRUE
if the cookie is only for the HTTP layer,FALSE
if cookie can be accessible in JavaScript.secure
is set toTRUE
if cookie must only be sent in HTTPS,FALSE
for HTTP and HTTPS.sameSite
is the value that defines security from cross-site attacks when cookies are used. Three values are possibles for sending cookies to other sites: "Strict", "Lax", or "None". The default is "Lax". IfNULL
, the default "Lax" is used.
Usage
The WSHelper.WSServerCookiesType
defines a dynamic array for storing cookies
that the server sends to the client.
For examples using this record, see com.HttpServiceRequest.setResponseCookies and Examples using com.HttpServiceRequest methods.