The mgiSetCookie Tag

Tag Behavior

The mgiSetCookie tag is used to set a cookie with a specified value.

Tag Syntax

The mgiSetCookie tag has a beginning tag with one required parameter and 3 optional parameters, a body, and an ending tag. The tag form is:

<mgiSetCookie name="Name" expireDate="Date" 
expireTime="Time" useEncryption="Yes/No">
Cookie Value

Required Parameters:

  • name="Name" where "Name" is the name of the cookie to be set.

Optional Parameters:

  • useEncryption="Yes" or "No" where "Yes" indicates that the cookie should be encrypted when set and "No" indicates that the cookie should not be encrypted when set. The default is "No".
  • expireDate="Date" where "Date" is the expiration Date of the cookie in the format mm-dd-yyyy (e.g. 12-31-2001).
  • expireTime="Time" where "Time" is the expiration Time of the cookie in military (24-hour) format hh:mm (e.g. 14:30).

Tag Body:

  • The body of the mgiSetCookie tag is the value of the cookie that is set.

Example Usage and Output

<mgiSetCookie name="Name" expireDate="10-31-99" expireTime="00:01">
<mgiFieldContent name="FirstName">
<mgiFieldContent name="LastName">

Used in conjunction with a form submission and mgiFieldContent tags, the mgiSetCookie in this example would set a Cookie with the first and last name entered by the visitor. The cookie would not be encrypted.

Suggested Usage

  • Cookies

[Return to the Referencing MGI Menu]

[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]