LassoScript Utility
Basics Browse Detail

[Cookie_Set]

Tag Link [Cookie_Set] Category Utility
Type Process Source Available No
Support Preferred Version 3.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x

Description

[Cookie_Set] sets a cookie with a given name and value. The rest of the parameters of the tag are optional, but should be set for best results.

-Domain identifies the domain which the cookie will be sent to by the Web browser. This should be the domain name of the current server. i.e. example.com.

-Expires is the expiration time of the cookie in minutes. If left blank the cookie will usually expire when the visitor's browser is quit. If set to -1 the cookie will be set to expire immediately so will be effectively deleted.

-Path identifies the path on the current server of pages to which the cookie should be sent. This will usually be set to / so the cookie is returned to every page within the current site. The path defaults to the folder which contains the current page.

-Secure specifies that the cookie should only be returned to pages which are served through the secure HTTPS protocol.

-HttpOnly specifies that the cookie should only be accessed by the server, and not by client scripts.

Syntax

[Cookie_Set: 'Cookie Name'='Cookie Value',
  -Domain='Domain Name',
  -Expires='Expiration in Minutes',
  -Path='Cookie Path',
  -Secure,
  -HttpOnly]

Parameters

Required Parameters
Cookie Name The name and value for the cookie which is to be set.
Optional Parameters
-Domain The name of the host to which this cookie should be sent.
-Expires The time in minutes when this cookie should expire. Omit this parameter to have a cookie expire when the visitor quits their Web browser. Set to -1 to have a cookie expire immediately (to delete a cookie).
-Path The path of files to which this cookie should be set. Usually set to /.
-Secure If set this cookie will only be sent back to the Web server on requests for HTTPS secure Web pages.
-HttpOnly If set this cookie will only be accessible by the server, and not by client scripts.

Examples

To set a cookie:

Use the [Cookie_Set] tag. The following example sets a cookie named First_Name to the value John. Since the -Expires parameter is not set the cookie will expire when the visitor quits their Web browser.

[Cookie_Set: 'First_Name'='John',
  -Domain='example.com',
  -Path='/']