Lasso Soft Inc. > Home

[ Cookie_Set ]

Method

[Cookie_Set] sets a cookie with a given name and value. The rest of the parameters of the method 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.

  • Syntax
Cookie_Set(
	'Cookie Name'='Cookie Value',
	-Domain='Domain Name',
	-Expires='Expiration in Minutes',
	-Path='Cookie Path',
	-Secure
)
Examples
  • Beginner

To set a cookie:

Use the [Cookie_Set] method. 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.

Code

Cookie_Set(
    'First_Name'='John',
    -Domain='example.com',
    -Path='/'
)
Resources
  • Articles

Recent Comments

The value of the cookie has to be a string.

Posted on: 11 May 2012

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft