SetCookie - cWebApp

Used to update a cookie key

Type: Procedure

Parameters: String sName String sValue Integer iOptExpires String sOptPath String sOptDomain Boolean bOptSecure Boolean bOptHttpOnly String sOptSameSite

ParameterDescription
sNameName of the cookie key
sValueNew value for the cookie key
iOptExpires(Optional) Number of hours before the cookie expires (0 = session).
sOptPath(Optional) A cookie can be placed for a specific path ('/' for the entire domain). Determines with which requests cookies are sent to the server.
sOptDomain(Optional) Domain for which the cookie is set.
bOptSecure(Optional) If True, the cookie is set as a secure cookie so it is only sent with HTTPS connections.
sOptHttpOnly(Optional) If True, the cookie is set as a http only cookie so that it is not accessible from JavaScript.


Syntax
Procedure SetCookie String sName String sValue Integer iOptExpires String sOptPath String sOptDomain Boolean bOptSecure Boolean bOptHttpOnly String sOptSameSite

Call: Send SetCookie sName sValue iOptExpires sOptPath sOptDomain bOptSecure bOptHttpOnly sOptSameSite


Description

SetCookie is used to update a cookie key's value and expiration time.

Note that SetCookie is implemented as a client-action, which makes it asynchronous and GetCookie will not return the new value until the next call arrives.

See Also

psSessionCookieSameSite | psSessionCookieName | psSessionCookiePath | psSessionCookieDomain