OpenWGA 7.11 - TMLScript reference

TMLContext "this"
Property :


On object TMLContext "this"
Usage Represents the browser cookies of the current user
Description Returns an Array of JavaEE cookie objects, representing the cookies that are set for the current browser session.

Every cookie object has the properties name, value, path, domain and more. For a complete reference see the  JavaEE API Dokumentation.

Returns null if there are no cookies.
Writable False
Return value Array of Java objects of type javax.servlet.http.Cookie
Allowed in script types
  • WebTML pages and normal WebTML actions
Examples Retrieving properties from cookie objects.


Since the property returns null if there are no cookies it is neccessary to test for it before testing the length of the cookies array:

if (cookies && cookies.length) {
  // Now we can safely address cookies[0]
  return cookies[0].name;