Document Tree
Document Properties
Kbid
C24743
Last Modified
04-Feb-2020
Added to KB
20-Jun-2013
Public Access
Everyone
Status
Online
Doc Type
References
Product
  • ICM 7.10
  • ICM 11
  • ICM 12
ISML Tag - ISCOOKIE

Name

ISCOOKIE

Short Description

sets a cookie

Table of Contents

Product Version

6.5

Product To Version

 

StatusNew Labels

Introduction

<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.

Syntax

<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:

  • Use the getCookie() function to read the cookie sent back by the client.
  • Use the getCookie() function to return the value of a request header field of the current request.

Example

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>

Attributes

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.

Reference - ISML Tags

Disclaimer
The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.
The Intershop Knowledge Portal uses only technically necessary cookies. We do not track visitors or have visitors tracked by 3rd parties. Please find further information on privacy in the Intershop Privacy Policy and Legal Notice.
Home
Knowledge Base
Product Releases
Log on to continue
This Knowledge Base document is reserved for registered customers.
Log on with your Intershop Entra ID to continue.
Write an email to supportadmin@intershop.de if you experience login issues,
or if you want to register as customer.