Saturday 28 Jan 2012   
Add Comment

CFCOOKIE example

ColdFusion Tutorial #37

Cookies are an essential part of modern web applications, often being used as a key element of user authentication. In a nutshell, cookies are values sent between a browser and a webserver and stored on the client's PC on a per domain basis.

For example:
username=fakeuser;password=5f4dcc3b5aa765d61d8327deb882cf99

In ColdFusion, these cookies can be accessed through the 'cookie' scope, with cookie.username and cookie.password .

Setting cookies is just as easy with the CFCOOKIE tag. All it needs is the name, and the value (The expiration time is optional).

To clear a cookie, all you need to do is set the cookie with an expiration of "NOW".

demo.cfm

Test



Demo

See this code running!


Download

Download this code as a zip!


Comments

hi
test @ Friday 06 May 2011 - 06:28:19 AM

ts
test @ Monday 12 Dec 2011 - 11:13:11 AM

Click button to add a comment


Author

Thomas Stiegler


Published

Tuesday 09 Jun 2009

Tags

cfcookie  cfelse  cfif  cfoutput  cfset