APPLICATION / OUTPUT |
The HTTP_COOKIES element contains any HTTP cookie definitions for an application. The main goal of cookies is to keep a state, through session variables, between two runs of an application by the same user. The number of cookies associated with an application should be constant.
The HTTP_COOKIE element takes a mandatory Id attribute and four optional attributes Expires, Domain, Secure and HttpOnly.
Expires attribute indicates the cookie expiration date.
Domain attribute restricts the cookie to a specified domain.
When set to TRUE, Secure attribute restricts the cookie to secured connections only.
When set to TRUE, HttpOnly attribute disables the cookie access from client-side scripting langage like JavaScriptâ„¢ running in a browser.
The HTTP_COOKIE element may contain the following child elements:
Zero or more VARIABLE elements.
Zero or more CONSTANT elements.
Each VARIABLE or CONSTANT element is defined by a mandatory identifier and an optional value.
<HTTP_COOKIES> <HTTP_COOKIE Id="cid" [Expires="endTime" | Domain="mydomain" | Secure="TRUE|FALSE" | HttpOnly=""]> <VARIABLE Id="varId">val</VARIABLE> [...] <CONSTANT Id="cstId">cst</CONSTANT> [...] <HTTP_COOKIE> [...] </HTTP_COOKIES>
cid is the cookie name.
endTime specifies the cookie expiration in "Day, DD-Mon-YYYY HH:MM:SS GMT" format. You can set a relative date with "X" or "+X" where X represents a number of seconds. "X" will fix the cookie date only at the creation time and "+X" will generate a new date for the cookie on each HTTP request.
mydomain is the domain name the cookie is restricted to.
varId is the variable name and val its value.
cstId is the constant name and cst its value.
<!-- secure persistent cookie with default variable value and constant value --> <HTTP_COOKIES> <HTTP_COOKIE Id="cookie3" Expires="Wdy, DD-Mon-YYYY HH:MM:SS GMT" Domain="www.domain.com" Secure="TRUE" HttpOnly="TRUE"> <VARIABLE Id="var7" /> <VARIABLE Id="var8">Initial value</VARIABLE> <CONSTANT Id="constant1">A value</CONSTANT> </HTTP_COOKIE> </HTTP_COOKIES>
For more information on HTTP cookies, refer to Session Variables and Cookies.