UpdateWebCookie (open)
Set or update a cookie on the client
Syntax
LOADLIB "mod::system/lib/webserver.whlib";
MACRO UpdateWebCookie(STRING name, STRING value, RECORD options)Parameters
STRING nameCookie name
STRING valueCookie value. If left empty, the existing cookie with the name will be deleted. Setting non-ASCII data is not recommended for unencrypted cookies
RECORD optionsCookie options
STRING domainCookie domain. Defaults to empty, in which case the cookie will be valid for the current host only
BOOLEAN encryptIf true, the cookie will be encrypted. Defaults to false
BOOLEAN httponlyIf true, mark a cookie as 'httponly', making it invisible to Javascript and helping to mitigate the damage of XSS attacks. Defaults to true
INTEGER64 lifetimeCookie maximum age (Max-Age) in seconds. If 0, the cookie will be a session cookie (the default)
STRING pathCookie path. Defaults to "/", making the cookie available for all URLs on this domain
STRING samesiteSameSite setting (empty, 'none', lax' or 'strict')
STRING secretkeyThe secret encryption key to use. If empty, a server generated key will be used.
BOOLEAN secureIf true, mark a cookie to only be transferred over secure connections.
Description
This function will set or update the value of a cookie on the client. Using this macro does not directly affect GetWebCookie, but should affect it on the next call.