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
TestDemo
See this code running!
Download
Download this code as a zip!
Comments
There are no comments!Click button to add a comment
Author
Thomas Stiegler