Skip to content

Instantly share code, notes, and snippets.

@roulupen
Created November 27, 2012 18:10
Show Gist options
  • Save roulupen/4155963 to your computer and use it in GitHub Desktop.
Save roulupen/4155963 to your computer and use it in GitHub Desktop.
Settng cookie by cfscript in ColdFusion 10
<cfscript>
/* ************** Setting Cookie by cfscript in ColdFusion 10 *********** */
//Type - 1
variables.cookieTest = structNew();
variables.cookieTest['value'] = "This is test Cokkie by me by using cfscript";
variables.cookieTest['expires'] = "10";
variables.cookieTest['secure'] = "yes";
variables.cookieTest['domain'] = "cf10";
cookie.myNewCookie = variables.cookieTest;
//Type - 2
cookie.yourNewCookie = {value: "This is a test cookie set by you by cfscript", expires: "10", secure: "yes", domain: "cf10"};
writeDump(cookie);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment