<ISCOOKIE>
is used to set a cookie in your system. A cookie is a message given to the web browser by the Intershop 7 system. A cookie allows you to store user-related information on the buyer's system, such as storefront preferences for a single buyer. Cookies can also be used to simplify the login procedure, so buyers don't have to type in their names and passwords each time they access the storefront. To accomplish this, the cookie would store a unique user ID on the buyer's system. After the cookie is stored, the browser returns it every time the buyer requests the URL of the issuing server.
<ISCOOKIE name = "( {String} | {ISML expression} )" value = "( {String} | {ISML expression} )" [ comment = "( {String} | {ISML expression} )" ] [ domain = "( {String} | {ISML expression} )" ] [ path = "( {String} | {ISML expression} )" ] [ maxAge = "( {String} | {ISML expression} )" ] [ version = "( {String} | {ISML expression} )" ] [ secure = "( on | off )" ] >
You can use the following functions to retrieve additional data:
getCookie()
function to read the cookie sent back by the client.getCookie()
function to return the value of a request header field of the current request.The following example shows how to set a cookie that can be used later to identify a customer:
<ISCOOKIE name = "UserID" value = "#Buyer:UUID#" comment = "your international customer ID" domain = ".foo.com" path = "/acme" maxAge = "10000" version = "0" secure = "on" >
The following example shows how to use a cookie that has been sent with the current request.
<ISIF condition = "#isdefined(getCookie("UserID"))#"> <ISREDIRECT location="#URL(Action('LoginPanel'))#"> </ISIF>
name
This attribute is required.
name = string | ISML expression
Specifies a name for the cookie. Names starting with "$" are not allowed.
value
This attribute is required.
value = string | ISML expression
Specifies the value that should be stored by the cookie, e.g., a user ID.
comment
This attribute is optional.
comment = string | ISML Expression
Allows you to document the intended use of the cookie. For example, if a cookie contains private information about a user, use the comment
attribute to mark the cookie accordingly. The user can then inspect the information to decide whether to accept the cookie or not.
domain
This attribute is optional.
domain = String | ISML Expression
Specifies the domain for which the cookie is valid. An explicitly specified domain must always start with a dot. If not specified, the browser will set the attribute domain to the domain that issues the cookie.
oath
This attribute is optional.
path = String | ISML expression
Specifies the subset of URLs to which this cookie applies. Pages outside of that path cannot use the cookie.
maxAge
This attribute is optional.
maxAge = String | ISML expression
Defines the lifetime of the cookie in seconds. After the specified time elapses, the buyer's browser can discard the cookie. A value of zero means the cookie can be discarded immediately.
version
This attribute is optional.
version = String | ISML expression
Identifies the version of the specification which the cookie conforms to. The default value is 0.
secure
This attribute is optional.
secure = on | off
The secure
attribute is a flag indicating that a cookie should only be used with a secure server, such as SSL. Default value is off.