OpenWGA 7.10 - TMLScript reference


Object:

Cookie

Description

Utility object to manage cookies

Retrieval

WGA.Call.createCookie()

WGA.Call.getCookie()

Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • Content type events
Properties and methods
Name Purpose
getValue([decode]) Gets the value of a cookie and optionally decodes it.
setDomain(value) Sets the domain property of the cookie.
setMaxAge(seconds) Sets the max age property of the cookie in seconds.
setPath(value) Sets the path property of the cookie.
setSameSite(value) Sets the sameSite property of the cookie.
setValue(value[, encode]) Sets the value of a cookie and optionally encodes it.
write() Writes the cookie to the HTTP Header of the current HTTP-Response object.
Examples
WGA.Call.createCookie("my-cookie")
.setValue("test")
.setMaxAge(60*60) // one hour
.write()